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:
1 parent
e8722cd815
commit
26c3365896
10 files changed
+97
-19
No files matched your search
@@ -0,0 +1,24 @@
|
||||
import { describe, expect, it } from "vitest";
|
||||
import { agentModel, defaultModelReach } from "../../src/shared/agent-model";
|
||||
import { effectiveModel } from "../../src/main/services/task-run-preparation";
|
||||
|
||||
describe("agent model", () => {
|
||||
it("names the model in effect and where it comes from", () => {
|
||||
expect(agentModel("gpt-6", "gpt-5")).toEqual({ model: "gpt-6", source: "agent" });
|
||||
expect(agentModel(" ", "gpt-5")).toEqual({ model: "gpt-5", source: "provider_default" });
|
||||
expect(agentModel(null, null)).toEqual({ model: null, source: "none" });
|
||||
// Runs start with exactly the model the UI shows.
|
||||
expect(effectiveModel(" gpt-6 ", "gpt-5")).toBe("gpt-6");
|
||||
expect(effectiveModel(null, "gpt-5")).toBe("gpt-5");
|
||||
});
|
||||
|
||||
it("counts the agents a default-model change reaches", () => {
|
||||
const agents = [
|
||||
{ modelProviderId: "p1", modelId: null },
|
||||
{ modelProviderId: "p1", modelId: "" },
|
||||
{ modelProviderId: "p1", modelId: "own" },
|
||||
{ modelProviderId: "p2", modelId: null },
|
||||
];
|
||||
expect(defaultModelReach(agents, "p1")).toEqual({ following: 2, ownModel: 1 });
|
||||
});
|
||||
});
|
||||
@@ -6,7 +6,7 @@ function run(agentId: string | null, contextJson: string | null): TaskRunRecord
|
||||
return {
|
||||
id: `run_${Math.random()}`, orgId: "org", taskId: "tsk", agentId, providerId: null, providerRequestId: null,
|
||||
executionContextId: null, serviceIdentityId: null, workspaceMountJson: "[]", secretScopeJson: "{}",
|
||||
trigger: "chat_mention", state: "completed", createdAt: "", startedAt: null, completedAt: null, errorMessage: null, contextJson, capabilityWarnings: null,
|
||||
trigger: "chat_mention", state: "completed", createdAt: "", startedAt: null, completedAt: null, errorMessage: null, contextJson, capabilityWarnings: null, runModel: null,
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user