fix(coding-agent): defer startup model catalog refresh
This commit is contained in:
@@ -709,7 +709,7 @@ export async function main(args: string[], options?: MainOptions) {
|
||||
message: "--api-key requires a model to be specified via --model, --provider/--model, or --models",
|
||||
});
|
||||
} else {
|
||||
await modelRuntime.setRuntimeApiKey(sessionOptions.model.provider, parsed.apiKey);
|
||||
await modelRuntime.setRuntimeApiKey(sessionOptions.model.provider, parsed.apiKey, { allowNetwork: false });
|
||||
await services.modelRuntime.getAvailable();
|
||||
}
|
||||
}
|
||||
@@ -808,6 +808,10 @@ export async function main(args: string[], options?: MainOptions) {
|
||||
process.exit(1);
|
||||
}
|
||||
|
||||
if (!offlineMode && (appMode === "interactive" || appMode === "rpc")) {
|
||||
void modelRuntime.refresh().catch(() => {});
|
||||
}
|
||||
|
||||
if (appMode === "rpc") {
|
||||
printTimings();
|
||||
await runRpcMode(runtime);
|
||||
|
||||
Reference in New Issue
Block a user