Merge 90af2e7e675d5557ed3afe66dd9e52b01dd42287 into 5e417b44e1540f528d2ae63e3e20229a902d1db2
This commit is contained in:
commit
eb63fc29c6
@ -14,6 +14,7 @@ import {
|
||||
resolveConfiguredModelRef,
|
||||
resolveThinkingDefault,
|
||||
resolveModelRefFromString,
|
||||
resolveSubagentConfiguredModelSelection,
|
||||
} from "./model-selection.js";
|
||||
|
||||
const EXPLICIT_ALLOWLIST_CONFIG = {
|
||||
@ -835,3 +836,21 @@ describe("normalizeModelSelection", () => {
|
||||
expect(normalizeModelSelection(42)).toBeUndefined();
|
||||
});
|
||||
});
|
||||
|
||||
describe("resolveSubagentConfiguredModelSelection", () => {
|
||||
it("prefers the target agent subagents.model over global defaults.subagents.model and agent.primary", () => {
|
||||
const cfg = {
|
||||
agents: {
|
||||
defaults: {
|
||||
subagents: { model: "minimax/MiniMax-M2.5" },
|
||||
model: { primary: "openai/gpt-5.4" },
|
||||
},
|
||||
list: [{ id: "research", model: { primary: "opencode/claude" } }],
|
||||
},
|
||||
} as OpenClawConfig;
|
||||
|
||||
expect(resolveSubagentConfiguredModelSelection({ cfg, agentId: "research" })).toBe(
|
||||
"minimax/MiniMax-M2.5",
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
@ -229,6 +229,24 @@ describe("openclaw-tools: subagents (sessions_spawn model + thinking)", () => {
|
||||
});
|
||||
});
|
||||
|
||||
it("sessions_spawn prefers target agent primary model over global subagent default", async () => {
|
||||
await expectSpawnUsesConfiguredModel({
|
||||
config: {
|
||||
session: { mainKey: "main", scope: "per-sender" },
|
||||
agents: {
|
||||
defaults: {
|
||||
subagents: { model: "minimax/MiniMax-M2.5" },
|
||||
model: { primary: "openai/gpt-5.4" },
|
||||
},
|
||||
list: [{ id: "research", model: { primary: "opencode/claude" } }],
|
||||
},
|
||||
},
|
||||
runId: "run-agent-primary-over-subagent-default",
|
||||
callId: "call-agent-primary-over-subagent-default",
|
||||
expectedModel: "minimax/MiniMax-M2.5",
|
||||
});
|
||||
});
|
||||
|
||||
it("sessions_spawn prefers target agent primary model over global default", async () => {
|
||||
await expectSpawnUsesConfiguredModel({
|
||||
config: {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user