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 <noreply@anthropic.com>
This commit is contained in:
Kevin
2026-04-01 03:34:17 +08:00
parent db04c3e0c0
commit 651335f682
2 changed files with 3 additions and 1 deletions

View File

@@ -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<boolean> {
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;
}

View File

@@ -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)