diff --git a/src/cliproxy/executor/index.ts b/src/cliproxy/executor/index.ts index fedd70b7..9b5da0ec 100644 --- a/src/cliproxy/executor/index.ts +++ b/src/cliproxy/executor/index.ts @@ -492,6 +492,28 @@ export async function execClaudeWithCLIProxy( // Multi-provider auth check for composite variants if (compositeProviders.length > 0) { + // Handle forceAuth for composite providers + if (forceAuth) { + const { triggerOAuth } = await import('../auth-handler'); + for (const p of compositeProviders) { + const authSuccess = await triggerOAuth(p, { + verbose, + add: addAccount, + ...(forceHeadless ? { headless: true } : {}), + ...(setNickname ? { nickname: setNickname } : {}), + ...(noIncognito ? { noIncognito: true } : {}), + ...(pasteCallback ? { pasteCallback: true } : {}), + ...(portForward ? { portForward: true } : {}), + }); + if (!authSuccess) { + const pConfig = getProviderConfig(p as CLIProxyProvider); + throw new Error(`Authentication failed for ${pConfig.displayName}`); + } + } + process.exit(0); + } + + // Check for unauthenticated providers const unauthenticatedProviders: string[] = []; for (const p of compositeProviders) { if (!isAuthenticated(p)) { diff --git a/ui/src/lib/api-client.ts b/ui/src/lib/api-client.ts index f5e437d7..5fefd08c 100644 --- a/ui/src/lib/api-client.ts +++ b/ui/src/lib/api-client.ts @@ -81,6 +81,13 @@ export interface UpdateVariant { provider?: CLIProxyProvider; model?: string; account?: string; + type?: 'composite'; + default_tier?: 'opus' | 'sonnet' | 'haiku'; + tiers?: { + opus: { provider: string; model: string; account?: string; thinking?: string }; + sonnet: { provider: string; model: string; account?: string; thinking?: string }; + haiku: { provider: string; model: string; account?: string; thinking?: string }; + }; } /** OAuth account info for multi-account support */