General config has no effect and gets overwritten by earlier config - Codex CC Switch
Quick fix
Upgrade to CC Switch v3.17.0+ to fix Codex general-config merging. If an old snapshot still overwrites it, switch to another provider and back to self-heal.
Symptom
Section titled “Symptom”通用配置勾选不生效Ticking the general config option has no effect
Root cause: older CC Switch ran parse → merge → stringify over the whole Codex `config.toml` in the front end using smol-toml. That path handles nested tables such as `[mcp_servers.<id>.tools.<tool>]` badly, losing comments and scrambling key order, so what gets written after ticking 通用配置 (general config) is stripped or overwritten (#2656). On top of that, CC Switch treats the provider snapshot (`providers.settings_config.config`) and the `mcp_servers` table as the source of truth and writes them back to the live `~/.codex/config.toml` when you switch provider, restart, or take over local routing — so MCP entries, plugins, and desktop settings you later changed or deleted in Codex get resurrected from the old snapshot (#956/#4697/#4699/#5149/#5049).
These reports are not all one bug. v3.17.0 moved merging to toml_edit in the backend and fixed the nested-table problem for general config, but #6344 still reports on 3.19.2 that the MCP panel toggle does not write `[mcp_servers]`, so the MCP write path is not fully covered. #1440, where v3.12.0/3.12.1 wiped the config down to just base_url, is a separate earlier path. Other variants: a model catalogue missing the `model` field or the `models` array so /model shows nothing (#3668/#4970/#4971); `model_provider` forcibly rewritten so session history is lost (#2844, fixed in v3.16.0); and the 1M context being read from the catalogue rather than the top-level config (#2614).
Upgrade to CC Switch v3.17.0 or newer, which fixes the old smol-toml merge that broke Codex general config.
If an old provider snapshot still overwrites it after upgrading, switch to another Codex provider and then back to the current one, which triggers snapshot self-healing on `providers.settings_config` and strips the stale `[mcp_servers]`.
In the CC Switch MCP panel, delete historical MCP entries you have already uninstalled (codegraph, for example) so they are not written back on every save.
If you need to keep Codex plugins or desktop settings, import them into 通用配置 (general config) by hand rather than relying on the live `~/.codex/config.toml` alone.
Affected Versions
Section titled “Affected Versions”Source Issues
Section titled “Source Issues”This page is distilled from 21 real issues
- #956[Bug][macOS 26.2] Codex Provider 修改已保存,但切换后 MCP 配置被改回旧内容
- #1440更新之后,所有配置都不写入,还会清除配置
- #2614codex开启1m上下文失败
- #2656codex通用配置问题
- #28443.15.0版本 会导致codex会话历史异常丢失
- #3356Codex 配置好供应商后点击启动后,无法覆盖config.toml,只有启用后,再重启软件才会写进去
- #3548关于codex的base_url配置
- #3668CC-Switch 写入的 config.toml 和 model-catalog 格式不被 Codex 识别,导致 /model 不显示第三方模型
- #4317Codex配置覆盖问题(已关闭问题重复报告)
- #4468打开 codex 应用增强模式时,启动第三方 api,会有一套旧配置覆盖掉当前配置
- #4697[Bug] Codex 普通 MCP 配置会被旧 provider 快照/CCS MCP 表回写,导致用户修改失效
- #4699Codex 普通 MCP 配置会被旧 provider 快照/CCS MCP 表回写,导致用户修改失效
- #4713[Bug] 从 OpenAI Official 切换到第三方 Provider 再切回后 Codex 卡在重连/需重新登录
- #4856历史配置覆盖新配置
- #4970[Bug] openai_chat + routing: model catalog generated but Codex desktop doesn't display models
- #4971[Bug] openai_chat + routing: model catalog generated but Codex desktop doesn't display models
- #5049插件仍然无法在供应商切换后保留安装
- #5149[Bug] 切换 Codex 供应商会覆盖 config.toml,导致 Codex Desktop 的插件与桌面设置丢失
- #5430RFC: Codex Provider configuration ownership, session routing, model mapping, and outbound proxy / Codex Provider 配置所有权、会话路由、模型映射与出站代理
- #6344[Bug] Codex 的 MCP 服务器只有导入没有写入,面板开关不会写入 ~/.codex/config.toml
- #6556[Bug] Codex 桌面 App 使用第三方供应商时完全不提供 web_search 工具(同配置 CLI 正常)
- I ticked general config and it does nothing — my hand-written config is still stripped after every switch. What now?
- Upgrade to CC Switch v3.17.0 or newer. If it still misbehaves, switch to another provider once and back to the current one to trigger the stale snapshot cleanup.
- Why does an MCP I deleted in Codex come back after saving?
- Because the CC Switch MCP panel still holds the entry and rewrites it on every save. Delete it in MCP management, then save again.
- My Codex plugins disappear after switching provider. How do I keep them?
- Import the plugin config into CC Switch 通用配置 (general config) by hand so it is stored in the database; only then is it restored after a switch or restart.
- Why is there only a base_url left in config.toml after upgrading?
- That is an early write problem in v3.12.0/v3.12.1, fixed in v3.16.1+ or v3.17.0. If it persists, check whether general config has any content and save it again.
Related problems
Section titled “Related problems”This is an unofficial community wiki with no affiliation to the cc-switch authors or the project itself. Its content is compiled from the project's public GitHub issues. This site distributes no software.