fix(codex/azure): 修复 Azure 认证与配置兼容,更新 Foundry v1 预设并避免 Test Model 误报#1309
Open
iAladdin wants to merge 4 commits intofarion1231:mainfrom
Open
fix(codex/azure): 修复 Azure 认证与配置兼容,更新 Foundry v1 预设并避免 Test Model 误报#1309iAladdin wants to merge 4 commits intofarion1231:mainfrom
iAladdin wants to merge 4 commits intofarion1231:mainfrom
Conversation
- Updated `test_api_endpoints` to accept an optional `app` parameter for better endpoint management. - Modified Codex settings to support both `OPENAI_API_KEY` and `AZURE_OPENAI_API_KEY`. - Improved endpoint handling in `handle_chat_completions` and related functions to preserve original paths and query parameters. - Added tests for new functionality in `SpeedtestService` and `ProxyService`. - Updated UI components to reflect changes in API key handling and status code reporting. - Enhanced localization files to include new status code messages.
…oving AZURE_OPENAI_API_KEY references
# Conflicts: # docs/user-manual/en/2-providers/2.1-add.md # docs/user-manual/ja/2-providers/2.1-add.md # docs/user-manual/zh/2-providers/2.1-add.md # src-tauri/src/services/proxy.rs # src-tauri/src/services/stream_check.rs # src/components/providers/forms/CodexFormFields.tsx # src/config/codexProviderPresets.ts # src/i18n/locales/en.json # src/i18n/locales/ja.json # src/i18n/locales/zh.json
…erations feat(auth): add Azure OpenAI API Key authentication strategy feat(codex): support Azure OpenAI endpoints and API versioning
Author
|
增加 Azure model 在 Codex App 26.317.21539 上的兼容性 |
Owner
|
很抱歉让你等了这么久。这个项目目前只有我一个人在维护,之前有段时间确实没能及时跟进。这是我的错。你的贡献对项目很重要,我会安排 review。如果需要 rebase 到最新代码,告诉我或者我直接来处理都可以。感谢你的付出和耐心。 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
背景
在通过 cc-switch 使用 Azure Codex 时,出现了两类问题:
Test Model偶发DeploymentNotFound(实际可用)。本 PR 目标是补齐 Codex + Azure 的配置与凭据兼容,统一行为并降低误报。
变更摘要
1) Codex 凭据兼容(OPENAI/AZURE 双 key)
OPENAI_API_KEYAZURE_OPENAI_API_KEY2) Azure 预设同步 Foundry v1
base_url使用/openai/v1env_key使用AZURE_OPENAI_API_KEYgpt-5.3-codex3) 修复 Test Model 的模型提取误报
modelmodel不在首行”导致回退到默认模型,从而触发DeploymentNotFound误判。关键文件与影响
src-tauri/src/services/provider/mod.rsCodex 凭据提取支持 Azure key。
src-tauri/src/deeplink/provider.rsDeeplink 导入支持 Azure key;Codex 默认模型更新。
src/components/providers/forms/hooks/useCodexConfigState.ts表单读写统一支持双 key,避免 Azure key 丢失。
src/components/providers/forms/CodexFormFields.tsx文案更新(模型 placeholder)。
src/components/UsageScriptModal.tsxUsage Script 测试可正确读取 Azure key。
src/config/codexProviderPresets.tsAzure 预设切换到 Foundry v1 配置。
兼容性与风险
OPENAI_API_KEY)。验证
pnpm typecheck通过cargo check -p cc-switch通过手动验证建议
AZURE_OPENAI_API_KEY的配置,确认 key/model/base_url 被正确识别。