From 6fefff2ef25f629dfbaf036b349f1be95bb35c80 Mon Sep 17 00:00:00 2001 From: HitMargin <142143104+2228293026@users.noreply.github.com> Date: Sat, 4 Apr 2026 10:54:13 +0800 Subject: [PATCH] claude-code with OpenAI mode fix (#102) Co-authored-by: HitMargin --- .githooks/pre-commit | 0 Run.ps1 | 2 ++ src/utils/auth.ts | 9 ++++----- 3 files changed, 6 insertions(+), 5 deletions(-) mode change 100755 => 100644 .githooks/pre-commit create mode 100644 Run.ps1 diff --git a/.githooks/pre-commit b/.githooks/pre-commit old mode 100755 new mode 100644 diff --git a/Run.ps1 b/Run.ps1 new file mode 100644 index 000000000..6741892cb --- /dev/null +++ b/Run.ps1 @@ -0,0 +1,2 @@ +bun install +bun run dev --dangerously-skip-permissions \ No newline at end of file diff --git a/src/utils/auth.ts b/src/utils/auth.ts index 64a618082..d278c3a4a 100644 --- a/src/utils/auth.ts +++ b/src/utils/auth.ts @@ -112,14 +112,13 @@ export function isAnthropicAuthEnabled(): boolean { return !!process.env.CLAUDE_CODE_OAUTH_TOKEN } + const settings = getSettings_DEPRECATED() || {} const is3P = isEnvTruthy(process.env.CLAUDE_CODE_USE_BEDROCK) || isEnvTruthy(process.env.CLAUDE_CODE_USE_VERTEX) || - isEnvTruthy(process.env.CLAUDE_CODE_USE_FOUNDRY) - - // Check if user has configured an external API key source - // This allows externally-provided API keys to work (without requiring proxy configuration) - const settings = getSettings_DEPRECATED() || {} + isEnvTruthy(process.env.CLAUDE_CODE_USE_FOUNDRY) || + (settings as any).modelType === 'openai' || + !!process.env.OPENAI_BASE_URL const apiKeyHelper = settings.apiKeyHelper const hasExternalAuthToken = process.env.ANTHROPIC_AUTH_TOKEN ||