Conversation
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.
feat(codex): configure shared and per-model approval models
Problem
Selecting a primary model in EasyCLIProxyAPI does not select the model used by Codex's automatic approval reviewer. With custom providers or model aliases, the reviewer can choose an unintended or unavailable model even when the primary model works normally.
In Codex rust-v0.153.2, the reviewer reads
auto_review_model_overridefrom the primary model's catalog entry. When present, that model ID is used. Otherwise, it looks for the provider's preferred review model (commonlycodex-auto-review) in the available catalog and falls back to the primary model if the preferred model is absent. This is automatic approval, not the code-review model setting. The override changes the model ID, not the provider; catalog membership alone does not guarantee upstream availability.UI and save behavior
AgentModelPicker, retaining the project's styling. Special choices are separate from actual model IDs, including IDs that happen to match a special choice's internal name.Precedence and persistence
auto_review_model_overrideCodex default removes the field, including any override carried by the source template. It does not preserve the template override or write a null/object value to the generated catalog.
The existing customization file stores the global
default_auto_review_modelseparately. A per-model null/absent selection inherits;{"mode":"codex_default"}explicitly bypasses the global setting; a string selects a model. The object is an editor-storage marker only.Approval policy and permissions are unchanged. The selected model must be callable through the configured proxy.
Validation
cargo test --locked --offline --manifest-path src-tauri/Cargo.toml codex_catalog:: --no-fail-fast: 33 passed. Includes the precedence matrix with/without template overrides, persistence/reload, new-model inheritance, stale revisions, and failed configuration applies.bun test tests/agentModelPicker.test.ts tests/codexModelCatalog.test.ts: 33 passed.npm run check: passed.git diff --check: passed.No real upstream automatic-approval request was exercised. The native check validates interaction and configuration generation, not upstream model availability.
中文翻译
问题背景
在 EasyCLIProxyAPI 中选择主模型,并不等于指定 Codex 自动审批使用的模型。使用自定义 provider 或模型别名时,即使主模型调用正常,自动审批仍可能选中非预期或不可用的模型。
在 Codex rust-v0.153.2 源码中,审批器读取主模型目录条目的
auto_review_model_override。存在该字段时使用指定模型 ID;否则在可用目录中查找 provider 首选审批模型(通常为codex-auto-review),不存在时回退主模型。这是自动审批模型,不是代码审查模型配置。该覆盖项只改变模型 ID,不切换 provider;模型出现在目录里也不保证上游可以调用。界面与保存入口
AgentModelPicker,沿用项目样式。特殊选项与真实模型 ID 分开,不会与同名模型发生冲突。优先级与持久化
auto_review_model_override“Codex 默认”会移除覆盖字段,包括源模板自带的覆盖;不是保留模板值,也不是向最终目录写入 null 或对象。
既有自定义配置文件分别保存全局
default_auto_review_model与单模型选择。单模型 null/缺省表示继承;{"mode":"codex_default"}表示明确绕过全局;字符串表示指定模型。对象仅为编辑器保存选择的标记。本改动不改变审批策略或权限。所选模型必须能够通过当前代理调用。
验证结果与边界
npm run check:通过。git diff --check:通过。未向真实上游发起自动审批请求。原生验收覆盖交互和配置生成,不代表真实上游模型可用性已验证。