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:
parent
dea13a37a6
commit
b62519b401
@ -49,6 +49,36 @@ describe("createBuiltinAgents with model overrides", () => {
|
|||||||
expect(agents.sisyphus.thinking).toBeUndefined()
|
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 () => {
|
test("Sisyphus is created on first run when no availableModels or cache exist", async () => {
|
||||||
// #given
|
// #given
|
||||||
const systemDefaultModel = "anthropic/claude-opus-4-5"
|
const systemDefaultModel = "anthropic/claude-opus-4-5"
|
||||||
|
|||||||
@ -451,7 +451,7 @@ export async function createBuiltinAgents(
|
|||||||
const atlasRequirement = AGENT_MODEL_REQUIREMENTS["atlas"]
|
const atlasRequirement = AGENT_MODEL_REQUIREMENTS["atlas"]
|
||||||
|
|
||||||
const atlasResolution = applyModelResolution({
|
const atlasResolution = applyModelResolution({
|
||||||
// NOTE: Atlas does NOT use uiSelectedModel - respects its own fallbackChain (k2p5 primary)
|
uiSelectedModel,
|
||||||
userModel: orchestratorOverride?.model,
|
userModel: orchestratorOverride?.model,
|
||||||
requirement: atlasRequirement,
|
requirement: atlasRequirement,
|
||||||
availableModels,
|
availableModels,
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user