codex - 💡(How to fix) Fix Codex Desktop on Windows crashes when rendering git UI directives with backslash cwd paths

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…

Error Message

Error: invalid syntax at line 1 col 5: cwd="D:\..."

Root Cause

This is not caused by git add, git commit, or repository corruption. It is specifically tied to rendering/parsing stored git UI directives with Windows path syntax.

Fix Action

Fix / Workaround

Local mitigation that restored affected threads:

Code Example

::git-stage{cwd="D:\\path\\to\\repo"}
::git-commit{cwd="D:\\path\\to\\repo"}

---

Error: invalid syntax at line 1 col 5:
cwd="D:\\..."

---

markdown-D32gobzN.js
local-conversation-thread-BKrlVhAv.js
review-file-source-tab-BmlwHNat.js

---

::git-stage{cwd="D:\\repo"}
RAW_BUFFERClick to expand / collapse

What version of the Codex App are you using (From “About Codex” dialog)?

Codex Desktop release observed in logs: 26.513.31313
App-server / command runner observed in logs: 0.131.0-alpha.9
Windows Store package path observed in logs: OpenAI.Codex_26.513.3673.0_x64__2p2nqsd0c76g0

What subscription do you have?

ChatGPT account / Codex Desktop. I am not sure which subscription value the issue template expects.

What platform is your computer?

Windows 11, x64. Locale/timezone observed in app diagnostics: zh-CN, Asia/Shanghai.

What issue are you seeing?

Codex Desktop can fail to open older conversation threads on Windows. The affected thread view shows the generic error boundary screen (“Something went wrong” / retry / check updates). Restarting the app does not fix it.

Local diagnostics show the renderer crashes while parsing assistant-visible git UI directives that contain Windows backslash paths in the cwd field, for example directive records shaped like:

::git-stage{cwd="D:\\path\\to\\repo"}
::git-commit{cwd="D:\\path\\to\\repo"}

The error captured by the app/Sentry breadcrumbs is:

Error: invalid syntax at line 1 col 5:
cwd="D:\\..."

The local renderer stack references bundles such as:

markdown-D32gobzN.js
local-conversation-thread-BKrlVhAv.js
review-file-source-tab-BmlwHNat.js

This appears to be a Desktop/UI rendering/parsing issue rather than a git issue. The underlying JSONL session files still parse as JSON, and the repositories/commits are intact.

What steps can reproduce the bug?

I can reproduce this locally by opening historical conversation threads that contain assistant final messages or rendered event messages with git UI directives whose cwd value is a Windows path using backslashes.

A minimal reproduction should be:

  1. Use Codex Desktop on Windows.

  2. Have a conversation/thread containing a rendered assistant-visible git directive with a Windows backslash cwd, such as:

    ::git-stage{cwd="D:\\repo"}
  3. Reopen or navigate to that thread in Codex Desktop.

  4. Observe that the conversation renderer hits the error boundary instead of displaying the thread.

What is the expected behavior?

The Desktop app should not crash when rendering historical git UI directives. It should either:

  • correctly parse Windows paths in directive fields,
  • tolerate/ignore malformed directive syntax,
  • render the directive as plain text if it cannot be parsed, or
  • normalize Windows paths before directive parsing.

What actually happens?

The thread fails to render and the UI shows the generic error screen. In local logs/Sentry breadcrumbs, the parser reports invalid syntax at line 1 col 5 with the offending text beginning at cwd="D:\\...".

Additional information

This surfaced after updating/restarting Codex Desktop on 2026-05-16. The bad directive lines appear to have existed in older session history already, but the current Desktop renderer is the first version on this machine that consistently crashes when opening those affected threads.

Local mitigation that restored affected threads:

  • Back up the affected JSONL session file.
  • Convert rendered git directive-only lines containing Windows backslash cwd values into plain text such as “Git operation record: stage/commit completed for repo D:/path/to/repo.”
  • Verify the JSONL still parses and that no rendered Windows git directive hits remain.

After that conversion, the affected conversation thread opens normally again.

This is not caused by git add, git commit, or repository corruption. It is specifically tied to rendering/parsing stored git UI directives with Windows path syntax.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING