From 651335f682baea6d07e0791cdfd4516c6d67aa13 Mon Sep 17 00:00:00 2001 From: Kevin Date: Wed, 1 Apr 2026 03:34:17 +0800 Subject: [PATCH] fix: skip auth and onboarding for OpenAI provider in interactive mode The interactive REPL was hanging because isAnthropicAuthEnabled() didn't recognize CLAUDE_CODE_USE_OPENAI as a 3rd party provider, triggering OAuth flows. Also skip setup screens (onboarding, trust dialog) when using the OpenAI shim. Co-Authored-By: Claude Opus 4.6 --- src/interactiveHelpers.tsx | 1 + src/utils/auth.ts | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/interactiveHelpers.tsx b/src/interactiveHelpers.tsx index b88dbbf1..ca3e4275 100644 --- a/src/interactiveHelpers.tsx +++ b/src/interactiveHelpers.tsx @@ -103,6 +103,7 @@ export async function renderAndRun(root: Root, element: React.ReactNode): Promis } export async function showSetupScreens(root: Root, permissionMode: PermissionMode, allowDangerouslySkipPermissions: boolean, commands?: Command[], claudeInChrome?: boolean, devChannels?: ChannelEntry[]): Promise { if ("production" === 'test' || isEnvTruthy(false) || process.env.IS_DEMO // Skip onboarding in demo mode + || isEnvTruthy(process.env.CLAUDE_CODE_USE_OPENAI) // Skip onboarding for OpenAI provider ) { return false; } diff --git a/src/utils/auth.ts b/src/utils/auth.ts index ebae9f98..27098c09 100644 --- a/src/utils/auth.ts +++ b/src/utils/auth.ts @@ -115,7 +115,8 @@ export function isAnthropicAuthEnabled(): boolean { const is3P = isEnvTruthy(process.env.CLAUDE_CODE_USE_BEDROCK) || isEnvTruthy(process.env.CLAUDE_CODE_USE_VERTEX) || - isEnvTruthy(process.env.CLAUDE_CODE_USE_FOUNDRY) + isEnvTruthy(process.env.CLAUDE_CODE_USE_FOUNDRY) || + isEnvTruthy(process.env.CLAUDE_CODE_USE_OPENAI) // Check if user has configured an external API key source // This allows externally-provided API keys to work (without requiring proxy configuration)