fix: 修复 Codex base_url 被写入错误 TOML section#1457
Closed
makoMakoGo wants to merge 1 commit intofarion1231:mainfrom
Closed
fix: 修复 Codex base_url 被写入错误 TOML section#1457makoMakoGo wants to merge 1 commit intofarion1231:mainfrom
makoMakoGo wants to merge 1 commit intofarion1231:mainfrom
Conversation
Collaborator
Author
|
还有点问题,我再思考下🤔 |
Collaborator
Author
|
codex |
Collaborator
Author
|
看到作者已经修了,就关闭了 🤗 |
Owner
在后端彻底重构了一下,感谢您的贡献! |
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.
Fixes #1441
用户视角的问题描述
用户在新增 Codex BYOK / 自定义供应商时,填写的 API 请求地址看起来已经保存成功,但实际写入
config.toml后,base_url可能被追加到文件最后一个 TOML section,而不是当前供应商对应的[model_providers.<name>]下。从用户角度看,现象就是:
base_url这个问题在配置里已经存在 Codex common config、并且 common config 会生成额外 section 时尤其容易触发,因为此时“追加到文件末尾”不再等价于“写入当前 provider section”。
说明:这个 PR 处理的是 Codex BYOK / 自定义渠道的
config.toml写入问题,不涉及官方 OAuth 登录令牌本身的生成或刷新逻辑。变更说明
base_url的读取和写入都基于当前model_provider做 section-aware 处理base_url写入[model_providers.<当前供应商>],不再简单追加到文件末尾base_url时,保存时会将其迁回当前供应商 section[model_providers.custom]后面还有其他 section 的场景测试
corepack pnpm vitest run tests\utils\providerConfigUtils.codex.test.ts tests\hooks\useCommonConfigSave.test.tsx tests\components\CommonConfigModalBehavior.test.tsx tests\components\AddProviderDialog.test.tsxcorepack pnpm tsc --noEmitcargo testinsrc-taurion commitdb42dfc8: passed (488unit tests insrc/lib.rsplus all Rust integration tests,0 failed)风险与验证建议
config.toml曾被手工修改,或者已经残留了被旧逻辑写到错误 section 的base_url,建议额外 spot check 一次config.toml中的base_url落在正确的[model_providers.<name>]section 内