From 3980d1b6b324c9fa4d4f16efae73d5fc6674c768 Mon Sep 17 00:00:00 2001 From: Ion Mudreac Date: Fri, 20 Feb 2026 08:17:17 +0800 Subject: [PATCH] =?UTF-8?q?fix(test):=20update=20oauth=20compat=20test=20t?= =?UTF-8?q?o=20reflect=20bidirectional=20token=E2=86=94oauth=20support?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The PR introduced bidirectional compat between 'oauth' and 'token' modes via isCompatibleModeType(), but the existing test 'rejects oauth credentials when config mode is token' was not updated to match the new behavior. With bidirectional compat, oauth-type credentials are now accepted when config mode is 'token' (both are bearer-token auth paths). Update the test name and assertion to reflect this intentional behavioral change. --- src/agents/auth-profiles/oauth.test.ts | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/agents/auth-profiles/oauth.test.ts b/src/agents/auth-profiles/oauth.test.ts index aeb936d275e..60c112aef68 100644 --- a/src/agents/auth-profiles/oauth.test.ts +++ b/src/agents/auth-profiles/oauth.test.ts @@ -60,7 +60,7 @@ describe("resolveApiKeyForProfile config compatibility", () => { expect(result).toBeNull(); }); - it("rejects oauth credentials when config mode is token", async () => { + it("accepts oauth credentials when config mode is token (bidirectional compat)", async () => { const profileId = "anthropic:oauth"; const store: AuthProfileStore = { version: 1, @@ -80,7 +80,12 @@ describe("resolveApiKeyForProfile config compatibility", () => { store, profileId, }); - expect(result).toBeNull(); + // token ↔ oauth are bidirectionally compatible bearer-token auth paths. + expect(result).toEqual({ + apiKey: "access-123", + provider: "anthropic", + email: undefined, + }); }); it("rejects credentials when provider does not match config", async () => {