From 30123a5496c94009510022af7512fb535f5de094 Mon Sep 17 00:00:00 2001 From: Ion Mudreac Date: Fri, 20 Feb 2026 16:58:25 +0800 Subject: [PATCH] fix(rebase): correct chutes-oauth return type and model-fallback test expectations - auth-choice.apply.oauth.ts: writeOAuthCredentials now returns void; use hardcoded 'chutes:default' profileId instead of discarded return value - model-fallback.e2e.test.ts: fix incorrect fallback expectations for model_not_found errors on override models; override model failures fall back to configured primary (openai/gpt-4.1-mini), not fallbacks --- src/agents/model-fallback.e2e.test.ts | 11 +++++++---- src/commands/auth-choice.apply.oauth.ts | 4 ++-- 2 files changed, 9 insertions(+), 6 deletions(-) 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", });