Q167: the model in effect and what a default change reaches are shown

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
ZacharyZhang-NYandClaude Opus 5.5 committed 2026-10-09 03:44:23 -04:00
1 parent e8722cd815
commit 26c3365896
10 files changed
+97 -19

No files matched your search

+17
View File
@@ -0,0 +1,17 @@
/** Where an agent's model comes from: its own setting, else its provider's default. */
export type ModelSource = "agent" | "provider_default" | "none";
/** The model a new session of the agent starts with; a running session keeps the one it pinned. */
export function agentModel(agentModelId: string | null, providerModel: string | null): { model: string | null; source: ModelSource } {
const own = agentModelId?.trim();
if (own) return { model: own, source: "agent" };
if (providerModel) return { model: providerModel, source: "provider_default" };
return { model: null, source: "none" };
}
/** Agents a change to this provider's default model reaches, and those that keep their own model. */
export function defaultModelReach(agents: Array<{ modelProviderId: string | null; modelId: string | null }>, providerId: string): { following: number; ownModel: number } {
const bound = agents.filter((agent) => agent.modelProviderId === providerId);
const ownModel = bound.filter((agent) => agent.modelId?.trim()).length;
return { following: bound.length - ownModel, ownModel };
}
+2
View File
@@ -211,6 +211,8 @@ export interface TaskRunRecord {
contextJson: string | null;
/** Capabilities the run could not load, one per line, so the user sees what it worked without. */
capabilityWarnings: string | null;
/** The model the session pinned when it started; null until then. */
runModel: string | null;
}
export interface ApprovalRecord {