From 6ff17d848091e1087ce2631ef2363e628346a8a2 Mon Sep 17 00:00:00 2001 From: Tam Nhu Tran Date: Thu, 12 Feb 2026 11:01:27 +0700 Subject: [PATCH] fix(cliproxy): improve multi-provider auth with continue-on-error pattern - Continue to remaining providers on auth failure instead of throwing - Aggregate failures and show summary of succeeded/failed providers - Improves UX when one provider fails in composite variant --- src/cliproxy/executor/index.ts | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/cliproxy/executor/index.ts b/src/cliproxy/executor/index.ts index 0f9502d7..92b42f49 100644 --- a/src/cliproxy/executor/index.ts +++ b/src/cliproxy/executor/index.ts @@ -497,6 +497,7 @@ export async function execClaudeWithCLIProxy( // Handle forceAuth for composite providers if (forceAuth) { const { triggerOAuth } = await import('../auth-handler'); + const failures: string[] = []; for (const p of compositeProviders) { const authSuccess = await triggerOAuth(p, { verbose, @@ -508,10 +509,17 @@ export async function execClaudeWithCLIProxy( ...(portForward ? { portForward: true } : {}), }); if (!authSuccess) { - const pConfig = getProviderConfig(p as CLIProxyProvider); - throw new Error(`Authentication failed for ${pConfig.displayName}`); + failures.push(p); } } + if (failures.length > 0) { + const succeeded = compositeProviders.filter((p) => !failures.includes(p)); + console.error(fail(`Auth failed for: ${failures.join(', ')}`)); + if (succeeded.length > 0) { + console.error(info(`Succeeded: ${succeeded.join(', ')}`)); + } + process.exit(1); + } process.exit(0); }