Skip to content

Commit 6fefff2

Browse files
2228293026HitMargin
andauthored
claude-code with OpenAI mode fix (#102)
Co-authored-by: HitMargin <hitmargin@qq.com>
1 parent a67b4a4 commit 6fefff2

File tree

3 files changed

+6
-5
lines changed

3 files changed

+6
-5
lines changed

.githooks/pre-commit

100755100644
File mode changed.

Run.ps1

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
bun install
2+
bun run dev --dangerously-skip-permissions

src/utils/auth.ts

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -112,14 +112,13 @@ export function isAnthropicAuthEnabled(): boolean {
112112
return !!process.env.CLAUDE_CODE_OAUTH_TOKEN
113113
}
114114

115+
const settings = getSettings_DEPRECATED() || {}
115116
const is3P =
116117
isEnvTruthy(process.env.CLAUDE_CODE_USE_BEDROCK) ||
117118
isEnvTruthy(process.env.CLAUDE_CODE_USE_VERTEX) ||
118-
isEnvTruthy(process.env.CLAUDE_CODE_USE_FOUNDRY)
119-
120-
// Check if user has configured an external API key source
121-
// This allows externally-provided API keys to work (without requiring proxy configuration)
122-
const settings = getSettings_DEPRECATED() || {}
119+
isEnvTruthy(process.env.CLAUDE_CODE_USE_FOUNDRY) ||
120+
(settings as any).modelType === 'openai' ||
121+
!!process.env.OPENAI_BASE_URL
123122
const apiKeyHelper = settings.apiKeyHelper
124123
const hasExternalAuthToken =
125124
process.env.ANTHROPIC_AUTH_TOKEN ||

0 commit comments

Comments
 (0)