Codex desktop app freezes on startup: MCP Windows path in config.toml triggers TOML parsing failure
What version of the Codex App are you using (From “About Codex” dialog)?
26.803.5235.0 (Microsoft Store / OpenAI.Codex)
What subscription do you have?
plus
What platform is your computer?
Windows 10 Build 26100 x64
What issue are you seeing?
Microsoft Store 版 Codex 桌面应用启动后窗口可以打开,但一直卡在加载/启动页面,无法进入主界面。修复、重置、重装应用均无效。
本地排查发现,原因是用户目录下的 config.toml 存在 TOML 语法错误:MCP 配置中的 Windows 路径使用了 TOML 双引号字符串,但路径里的反斜杠没有转义。
示例:
args = ["-NoLogo", "...", "-File", "F:\ChatGPT-projiect\deepseek-mcp-local\start-deepseek-mcp.ps1"]
在 TOML 双引号字符串中,\d 是非法转义序列,导致整个配置解析失败。
日志反复出现:
failed to reload config: C:\Users\<user>\.codex\config.toml:150:77:
missing escaped value, expected b, e, f, n, r, \, ", x, u, U
受影响功能看起来包括:
- config/read
- plugin/list
- bundled_plugins_reconcile
- windowsSandbox/setupStart
最终表现为 UI 无限等待,用户只能看到启动页卡死,没有明确错误提示。
What steps can reproduce the bug?
- 在 Windows 上安装 Microsoft Store 版 ChatGPT/Codex。
- 在 C:\Users\<user>\.codex\config.toml 中添加一个 MCP server 配置。
- 在 args 里使用 TOML 双引号字符串保存 Windows 路径,例如:
args = ["-NoLogo", "...", "-File", "F:\ChatGPT-projiect\deepseek-mcp-local\start-deepseek-mcp.ps1"]
- 重启 Codex。
- Codex 窗口显示,但卡在加载/启动页,无法进入主界面。
临时修复:将路径改为正斜杠后可以正常启动:
args = ["-NoLogo", "...", "-File", "F:/ChatGPT-projiect/deepseek-mcp-local/start-deepseek-mcp.ps1"]
或者使用 TOML 单引号字符串:
args = ['-NoLogo', '...', '-File', 'F:\ChatGPT-projiect\deepseek-mcp-local\start-deepseek-mcp.ps1']
What is the expected behavior?
- config.toml 解析失败时,不应阻塞整个 Codex 应用启动。
- Codex 应进入 safe mode / fallback,跳过损坏的 MCP 配置段。
- UI 应显示明确错误,例如:“config.toml 第 150 行语法错误,MCP server deepseek 已跳过。”
- 如果路径由 GUI 写入,应自动使用 /、\\,或 TOML 单引号字符串。
- 启动阶段应先做配置健康检查,避免所有 RPC handler 因配置错误而不可用。
Additional information
此问题对普通用户很难定位,因为重装、重置和修复应用都不会自动移除用户目录下损坏的 C:\Users\<user>\.codex\config.toml。建议启动失败时在 UI 中暴露具体配置文件路径、行号和可恢复操作。
2 Comments
English translation:
What version of the Codex App are you using (From “About Codex” dialog)?
26.803.5235.0 (Microsoft Store / OpenAI.Codex)
What subscription do you have?
pro
What platform is your computer?
Windows 10 Build 26100 x64
What issue are you seeing?
The Microsoft Store version of the Codex desktop app opens its window after launch but remains stuck on the loading/startup screen and cannot reach the main interface. Repairing, resetting, and reinstalling the app do not resolve the issue.
Local investigation found that the cause is a TOML syntax error in config.toml under the user directory: a Windows path in the MCP configuration uses a TOML double-quoted string, but the backslashes in the path are not escaped.
Example:
args = ["-NoLogo", "...", "-File", "F:\ChatGPT-projiect\deepseek-mcp-local\start-deepseek-mcp.ps1"]
In a TOML double-quoted string, \d is an invalid escape sequence, causing the entire configuration to fail to parse.
The following repeatedly appears in the logs:
failed to reload config: C:\Users\<user>\.codex\config.toml:150:77:
missing escaped value, expected
b,e,f,n,r,\,",x,u,UThe affected functionality appears to include:
The result is that the UI waits indefinitely, and the user sees only a frozen startup screen with no clear error message.
What steps can reproduce the bug?
args = ["-NoLogo", "...", "-File", "F:\ChatGPT-projiect\deepseek-mcp-local\start-deepseek-mcp.ps1"]
Temporary workaround: changing the path to use forward slashes allows the app to start normally:
args = ["-NoLogo", "...", "-File", "F:/ChatGPT-projiect/deepseek-mcp-local/start-deepseek-mcp.ps1"]
Alternatively, use TOML single-quoted strings:
args = ['-NoLogo', '...', '-File', 'F:\ChatGPT-projiect\deepseek-mcp-local\start-deepseek-mcp.ps1']
What is the expected behavior?
Additional information
This issue is very difficult for ordinary users to diagnose because reinstalling, resetting, or repairing the app does not automatically remove the corrupted C:\Users\<user>\.codex\config.toml from the user directory. When startup fails, the UI should expose the specific configuration file path, line number, and available recovery actions.
<!-- codex-issue-translator -->
Potential duplicates detected. Please review them and close your issue if it is a duplicate.
Powered by Codex Action