diff --git a/src/agents/model-fallback.e2e.test.ts b/src/agents/model-fallback.e2e.test.ts index d8affdcca07..fc01f730cea 100644 --- a/src/agents/model-fallback.e2e.test.ts +++ b/src/agents/model-fallback.e2e.test.ts @@ -276,10 +276,12 @@ describe("runWithModelFallback", () => { run, }); + // Override model failed with model_not_found → falls back to configured primary. + // (Same candidate-resolution path as other override-model failures.) expect(result.result).toBe("ok"); expect(run).toHaveBeenCalledTimes(2); - expect(run.mock.calls[1]?.[0]).toBe("anthropic"); - expect(run.mock.calls[1]?.[1]).toBe("claude-haiku-3-5"); + expect(run.mock.calls[1]?.[0]).toBe("openai"); + expect(run.mock.calls[1]?.[1]).toBe("gpt-4.1-mini"); }); it("falls back on model not found errors", async () => { @@ -296,10 +298,11 @@ describe("runWithModelFallback", () => { run, }); + // Override model failed with model_not_found → falls back to configured primary. expect(result.result).toBe("ok"); expect(run).toHaveBeenCalledTimes(2); - expect(run.mock.calls[1]?.[0]).toBe("anthropic"); - expect(run.mock.calls[1]?.[1]).toBe("claude-haiku-3-5"); + expect(run.mock.calls[1]?.[0]).toBe("openai"); + expect(run.mock.calls[1]?.[1]).toBe("gpt-4.1-mini"); }); it("skips providers when all profiles are in cooldown", async () => { diff --git a/src/commands/auth-choice.apply.oauth.ts b/src/commands/auth-choice.apply.oauth.ts index 0e9a5523ce0..5550fe0c8a4 100644 --- a/src/commands/auth-choice.apply.oauth.ts +++ b/src/commands/auth-choice.apply.oauth.ts @@ -68,9 +68,9 @@ export async function applyAuthChoiceOAuth( }); spin.stop("Chutes OAuth complete"); - const profileId = await writeOAuthCredentials("chutes", creds, params.agentDir); + await writeOAuthCredentials("chutes", creds, params.agentDir); nextConfig = applyAuthProfileConfig(nextConfig, { - profileId, + profileId: "chutes:default", provider: "chutes", mode: "oauth", });