API Service 会持续自动改写 Codex 的 config.toml,无法保留用户自定义配置
Author: Rodris-zhangCreated Sep 17, 2026Updated Sep 17, 2026
问题描述
目前使用 Cockpit 的 Codex API Service 时,发现 Cockpit 会持续自动修改:
~/.codex/config.toml
即使已经手动将 config.toml 修改成自己需要的配置,之后启动 Cockpit、启动 API Service,或者运行一段时间后,配置仍然可能再次被 Cockpit 自动覆盖。
例如,我自己配置了 custom provider、model、reasoning effort、context window 等参数,但 Cockpit 会重新写入类似:
model_provider = "codex_local_access"
model_catalog_json = "cockpit-model-catalog.json"以及对应的 [model_providers.codex_local_access] 配置。
这会导致用户自己的 Codex 配置被破坏。
期望行为
我认为这里应该把两个功能完全分开:
- 启动 Cockpit API Service
- 自动修改 Codex 配置并切换到 Cockpit API Service
如果用户只是启动 API Service,Cockpit 应该只负责提供 localhost API,例如:
http://localhost:xxxxx/v1然后允许用户自己在 config.toml 中配置这个 endpoint。
只有用户明确点击“切换到 API 服务”或类似操作时,Cockpit 才应该修改 config.toml。
更重要的是,Cockpit 不应该在后台持续检查并强制恢复 config.toml。如果用户之后手动修改了配置,应当认为用户的配置优先,而不是再次自动覆盖。
建议
希望增加以下其中一种机制:
- 增加“不要管理 Codex config.toml / Disable config takeover”选项;
- API Service 与 Codex 配置接管完全解耦;
- 允许默认 Codex 实例设置为“不绑定”;
- 用户手动修改
config.toml后,不再自动执行 self-heal / takeover; - 至少提供一个明确的“解除 API Service 配置接管”按钮。
理想状态应该是:
Cockpit API Service = Enabled
Codex config takeover = Disabled这样 Cockpit 只作为账号池和本地 API Gateway 使用,而 ~/.codex/config.toml 完全由用户自己管理。
建议至少让这种自动接管行为可以关闭,并且不要默认持续覆盖用户的配置文件。
感谢!
Source: jlcodes99/cockpit-tools