feat(coding-agent): add model catalog refresh flag

This commit is contained in:
Armin Ronacher
2026-07-16 12:46:49 +02:00
parent 2be9efa19c
commit 97f9978fa6
13 changed files with 148 additions and 19 deletions
+11 -1
View File
@@ -38,11 +38,15 @@ export interface RefreshModelsContext {
store: ProviderModelsStore;
/** False during offline/cache-only initialization. */
allowNetwork: boolean;
/** Bypass provider freshness checks and fetch immediately when network access is allowed. */
force?: boolean;
signal?: AbortSignal;
}
export interface ModelsRefreshOptions {
allowNetwork?: boolean;
/** Bypass provider freshness checks and fetch immediately when network access is allowed. */
force?: boolean;
signal?: AbortSignal;
}
@@ -290,7 +294,13 @@ class ModelsImpl implements MutableModels {
stored = await this.readCredential(provider.id);
const credential = await this.resolveRefreshCredential(provider, stored, allowNetwork, options.signal);
if (!credential) return;
await provider.refreshModels({ credential, store, allowNetwork, signal: options.signal });
await provider.refreshModels({
credential,
store,
allowNetwork,
force: options.force,
signal: options.signal,
});
} catch (error) {
if (!options.signal?.aborted) {
errors.set(