feat(agents): respect uiSelectedModel in Atlas model resolution (#1410)

Atlas now respects uiSelectedModel when resolving model in createBuiltinAgents. Added test coverage for this behavior.
This commit is contained in:
YeonGyu-Kim
2026-02-03 12:11:42 +09:00
committed by GitHub
parent dea13a37a6
commit b62519b401
2 changed files with 41 additions and 11 deletions
+30
View File
@@ -49,6 +49,36 @@ describe("createBuiltinAgents with model overrides", () => {
expect(agents.sisyphus.thinking).toBeUndefined()
})
test("Atlas uses uiSelectedModel when provided", async () => {
// #given
const fetchSpy = spyOn(shared, "fetchAvailableModels").mockResolvedValue(
new Set(["openai/gpt-5.2", "anthropic/claude-sonnet-4-5"])
)
const uiSelectedModel = "openai/gpt-5.2"
try {
// #when
const agents = await createBuiltinAgents(
[],
{},
undefined,
TEST_DEFAULT_MODEL,
undefined,
undefined,
[],
undefined,
undefined,
uiSelectedModel
)
// #then
expect(agents.atlas).toBeDefined()
expect(agents.atlas.model).toBe("openai/gpt-5.2")
} finally {
fetchSpy.mockRestore()
}
})
test("Sisyphus is created on first run when no availableModels or cache exist", async () => {
// #given
const systemDefaultModel = "anthropic/claude-opus-4-5"