fix(agents): restore correct precedence: subagents.model > defaults.subagents.model > agent.primary
This commit is contained in:
parent
fbc62c4976
commit
90af2e7e67
@ -829,7 +829,7 @@ describe("normalizeModelSelection", () => {
|
||||
});
|
||||
|
||||
describe("resolveSubagentConfiguredModelSelection", () => {
|
||||
it("prefers the target agent primary model over the global subagent default", () => {
|
||||
it("prefers the target agent subagents.model over global defaults.subagents.model and agent.primary", () => {
|
||||
const cfg = {
|
||||
agents: {
|
||||
defaults: {
|
||||
@ -841,7 +841,7 @@ describe("resolveSubagentConfiguredModelSelection", () => {
|
||||
} as OpenClawConfig;
|
||||
|
||||
expect(resolveSubagentConfiguredModelSelection({ cfg, agentId: "research" })).toBe(
|
||||
"opencode/claude",
|
||||
"minimax/MiniMax-M2.5",
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
@ -381,8 +381,8 @@ export function resolveSubagentConfiguredModelSelection(params: {
|
||||
const agentConfig = resolveAgentConfig(params.cfg, params.agentId);
|
||||
return (
|
||||
normalizeModelSelection(agentConfig?.subagents?.model) ??
|
||||
normalizeModelSelection(agentConfig?.model) ??
|
||||
normalizeModelSelection(params.cfg.agents?.defaults?.subagents?.model)
|
||||
normalizeModelSelection(params.cfg.agents?.defaults?.subagents?.model) ??
|
||||
normalizeModelSelection(agentConfig?.model)
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@ -244,7 +244,7 @@ describe("openclaw-tools: subagents (sessions_spawn model + thinking)", () => {
|
||||
},
|
||||
runId: "run-agent-primary-over-subagent-default",
|
||||
callId: "call-agent-primary-over-subagent-default",
|
||||
expectedModel: "opencode/claude",
|
||||
expectedModel: "minimax/MiniMax-M2.5",
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user