fix(call-omo-agent): use variant-aware model parsing for overrides

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
This commit is contained in:
YeonGyu-Kim
2026-04-01 18:17:15 -07:00
parent 51d9685571
commit 9c85ef446e
2 changed files with 53 additions and 3 deletions
+50
View File
@@ -265,6 +265,56 @@ describe("createCallOmoAgent", () => {
})
})
test("parses inline model variant from agent config override", async () => {
//#given
const launch = mock((_input: { model?: { providerID: string; modelID: string; variant?: string } }) => Promise.resolve({
id: "task-inline-variant",
sessionID: "sub-session",
description: "Test task",
agent: "explore",
status: "pending",
}))
const managerWithLaunch = {
launch,
getTask: mock(() => undefined),
}
const toolDef = createCallOmoAgent(
mockCtx,
managerWithLaunch,
[],
{
explore: {
model: "openai/gpt-5.4 high",
},
},
)
const executeFunc = toolDef.execute as Function
//#when
await executeFunc(
{
description: "Test inline variant",
prompt: "Test prompt",
subagent_type: "explore",
run_in_background: true,
},
{ sessionID: "test", messageID: "msg", agent: "test", abort: new AbortController().signal }
)
//#then
const firstLaunchCall = launch.mock.calls[0]
if (firstLaunchCall === undefined) {
throw new Error("Expected launch to be called")
}
const [launchArgs] = firstLaunchCall
expect(launchArgs.model).toEqual({
providerID: "openai",
modelID: "gpt-5.4",
variant: "high",
})
})
test("forwards category-derived model override to background executor", async () => {
//#given
const launch = mock((_input: { model?: { providerID: string; modelID: string } }) => Promise.resolve({