Skip to content

ChatGPT cannot load config.toml: Codex Desktop

Quick fix

Remove residual API login preferences from the Codex configuration and CC Switch saved configuration, then reopen the old conversation.

Error output
ChatGPT 无法加载 config.toml,因此此对话串无法继续。
请修复 config.toml:Model provider `custom` not found。
保存文件后,重新打开此对话串。
English translation

ChatGPT cannot load config.toml, so this conversation cannot continue. Please fix config.toml: Model provider `custom` not found。 After saving the file, reopen this conversation.

In this report, after switching to OpenAI Official OAuth, `preferred_auth_method = "apikey"` remained in the Codex shared configuration, official provider configuration, and actual `config.toml`. Comment review stated that CC Switch does not read or interpret this key; it is a Codex authentication preference and may have been written by a previously used third-party switching script.

The old conversation still references an undefined `custom` model provider, so it cannot open. The report did not confirm that the residual API login preference caused OAuth login expiration, nor that removing the key fixes the old conversation's `custom` provider error.

  1. Remove the residual API login preference from the active Codex configuration; also remove `forced_login_method` if present.

    ~/.codex/config.toml
    preferred_auth_method = "apikey"
    forced_login_method = "api"
  2. Clear the same residual configuration lines from CC Switch's Codex shared configuration and OpenAI Official provider saved configuration.

  3. Reopen the old conversation. If `Model provider `custom` not found` still appears, the old session still references a provider absent from the current configuration; do not attribute this to the API login preference.

ToolCodex Desktop
Version3.20.4(报告版本;是否为受影响版本未证实)
PlatformsWindows
Is `preferred_auth_method = "apikey"` still valid in the current version?
Comment review stated that CC Switch does not read or interpret this key; it may only have meaning to Codex itself.
Can removing this key clear the “login expired” message or fix the old session?
This has not been verified. The report explicitly states that this key cannot be identified as the cause of authentication expiration; the old session's `custom` provider error was also not fixed by this cleanup.

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.