fix(model-fallback): align OpenAI fallback resolution across CLI and runtime

Keep install-time and runtime model tables in sync, stop OpenAI-only misrouting when OpenCode Go is present, and add valid OpenAI fallbacks for atlas, metis, and sisyphus-junior.

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-03-14 13:46:26 +09:00
parent b63082a3bb
commit 532995bb51
11 changed files with 276 additions and 355 deletions
+22
View File
@@ -966,6 +966,28 @@ describe("createBuiltinAgents with requiresAnyModel gating (sisyphus)", () => {
cacheSpy.mockRestore()
}
})
test("atlas and metis resolve to OpenAI in an OpenAI-only environment without a system default", async () => {
// #given
const fetchSpy = spyOn(shared, "fetchAvailableModels").mockResolvedValue(new Set(["openai/gpt-5.4"]))
const cacheSpy = spyOn(connectedProvidersCache, "readConnectedProvidersCache").mockReturnValue(["openai"])
try {
// #when
const agents = await createBuiltinAgents([], {}, undefined, undefined, undefined, undefined, [], {})
// #then
expect(agents.atlas).toBeDefined()
expect(agents.atlas.model).toBe("openai/gpt-5.4")
expect(agents.atlas.variant).toBe("medium")
expect(agents.metis).toBeDefined()
expect(agents.metis.model).toBe("openai/gpt-5.4")
expect(agents.metis.variant).toBe("high")
} finally {
fetchSpy.mockRestore()
cacheSpy.mockRestore()
}
})
})
describe("buildAgent with category and skills", () => {