第三方模型仍自称 based on GPT-5 - Codex
Quick fix
将 baseInstructions 覆盖逻辑从 if profile != ProxyChat 块移出,使其对 ProxyChat 生效;当前即使配置了 baseInstructions 也不会注入。
Symptom
Section titled “Symptom”模型回答中提到 "GPT-5",而非实际模型名根因位于 `src-tauri/src/codex_config.rs` 的 `codex_catalog_model_entry()`(L498):`baseInstructions` 覆盖逻辑被包在 `if profile != CodexCatalogToolProfile::ProxyChat` 条件块内。`CodexCatalogToolProfile::from_api_format()`(L146-153)会把所有 `apiFormat` 不是 `"openai_responses"` 或 `"anthropic"` 的 provider 归入 ProxyChat;ProxyChat 模板来自 `models_cache.json`、`codex debug models --bundled` 或静态 `gpt5_5_template.json`,这些来源的 `base_instructions` 首句都是 "You are Codex, a coding agent **based on GPT-5**."。因此 DeepSeek、Qwen、Moonshot 等通过 `openai_chat` 代理接入 Codex 时,模型会沿用模板自我介绍为 GPT-5。Issue #5969 建议将覆盖逻辑移出该 `if` 块;截至该 issue 仍为 open,未看到已合并修复或维护者确认,当前属于代码级修复方案。
确认你的 provider 使用 `apiFormat: "openai_chat"`(或任何非 `openai_responses` / `anthropic` 格式),此时 Codex 会进入 ProxyChat 分支。
编辑 `src-tauri/src/codex_config.rs`,将 `baseInstructions` 覆盖逻辑移到 `if profile != CodexCatalogToolProfile::ProxyChat` 块之外,使其对所有 profile 生效。
// src-tauri/src/codex_config.rsif let Some(base_instructions) = spec.base_instructions.as_deref().map(str::trim).filter(|s| !s.is_empty()){entry_obj.insert("base_instructions".to_string(), json!(base_instructions));}if profile != CodexCatalogToolProfile::ProxyChat {// 原有 tools 清理 + supports_parallel_tool_calls 逻辑保持不变// ...}重新构建并运行 cc-switch,再问 Codex "What model are you based on?",确认回答不再包含 "based on GPT-5"。
Affected Versions
Section titled “Affected Versions”Source Issues
Section titled “Source Issues”本页汇总自 1 个真实 issue
(暂无 FAQ)
这是一个非官方社区 wiki,与 cc-switch 作者及项目本身无隶属关系。内容整理自项目公开的 GitHub issues。本站不分发任何软件。