mirror of
https://github.com/openclaw/openclaw.git
synced 2026-06-07 22:09:57 +00:00
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
This commit is contained in:
@@ -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 () => {
|
||||
|
||||
@@ -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",
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user