From e3553b3211cc90db56bb0e7f84d86772d4e8b796 Mon Sep 17 00:00:00 2001 From: can1357 Date: Tue, 12 May 2026 06:56:39 +0200 Subject: [PATCH] test(coding-agent): align kNoAuth fallback test with #1008 behavior --- .../test/issue-985-subagent-auth-fallback.test.ts | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/packages/coding-agent/test/issue-985-subagent-auth-fallback.test.ts b/packages/coding-agent/test/issue-985-subagent-auth-fallback.test.ts index 2d7871983..7ccfcfadb 100644 --- a/packages/coding-agent/test/issue-985-subagent-auth-fallback.test.ts +++ b/packages/coding-agent/test/issue-985-subagent-auth-fallback.test.ts @@ -151,10 +151,11 @@ describe("issue #985: subagent dispatch auth fallback", () => { }); test("treats keyless providers (kNoAuth marker) as authenticated", async () => { - // Keyless providers (Ollama, llama.cpp without configured token) return - // the kNoAuth sentinel. isAuthenticated treats this as not-authed, so - // the helper should fall back to the parent — ensuring users on a - // real authed parent never get downgraded to an unreachable local proxy. + // Keyless-by-design providers (Ollama, llama.cpp, lm-studio) advertise the + // kNoAuth sentinel from getApiKey to signal that they do not require + // credentials. The helper treats this as authenticated so an explicitly + // configured local model is never silently rerouted to the parent's + // remote provider (see #1008). const registry: ModelLookupRegistry & { getApiKey(model: Model): Promise } = { getAvailable: () => [parentModel, unauthedTaskModel], getApiKey: async (model: Model) => { @@ -170,7 +171,8 @@ describe("issue #985: subagent dispatch auth fallback", () => { registry, ); - expect(result.authFallbackUsed).toBe(true); - expect(result.model?.provider).toBe("deepseek"); + expect(result.authFallbackUsed).toBe(false); + expect(result.model?.provider).toBe("opencode-zen"); + expect(result.model?.id).toBe("qwen3.6-plus-free"); }); });