From 3d62e43ab52010ef5cce86b6aaf00a0e79dbf75e Mon Sep 17 00:00:00 2001 From: PabloGNU Date: Tue, 7 Apr 2026 16:11:12 +0200 Subject: [PATCH] fix: normalizeKey doesn't add :default suffix When no profile is provided, normalizeKey now returns the base providerID without appending ':default'. This ensures backward compatibility - existing auth.json entries with bare provider keys work correctly. --- packages/opencode/src/auth/index.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/opencode/src/auth/index.ts b/packages/opencode/src/auth/index.ts index 415e1767b9..f28a6a42f6 100644 --- a/packages/opencode/src/auth/index.ts +++ b/packages/opencode/src/auth/index.ts @@ -13,9 +13,9 @@ const fail = (message: string) => (cause: unknown) => new Auth.AuthError({ messa const normalizeKey = (providerID: string, profile?: string): string => { const base = providerID.replace(/\/+$/, "") - // If key already contains a profile separator and no profile arg provided, treat as already normalized + // If key already contains a profile separator, treat as already normalized if (!profile && base.includes(":")) return base - return profile ? `${base}:${profile}` : `${base}:default` + return profile ? `${base}:${profile}` : base } export namespace Auth {