Codex desktop fails to render reopened thread containing assistant-emitted git directive blocks

Resolved 💬 5 comments Opened May 16, 2026 by BearKouber Closed May 16, 2026
💡 Likely answer: A maintainer (github-actions[bot], contributor) responded on this thread — see the highlighted reply below.

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

Codex desktop 26.513.31313

What subscription do you have?

ChatGPT Plus

What platform is your computer?

Windows 10.0.19045 x64

What issue are you seeing?

Codex desktop fails to render a reopened conversation when an assistant message contains git directive-like text such as ::git-stage{...} or ::git-commit{...}.

This is not limited to standalone directive lines. I reproduced it when the assistant included the directive-like text inside normal explanatory text and inline code spans.

The same conversation can still be opened/read outside the desktop renderer, but the Codex desktop app fails to render it after reopening from the sidebar.

The failure appears to happen when the desktop renderer re-parses assistant-emitted directive-like text and then crashes while parsing the cwd="P:\Codex\001_demo" payload.

What steps can reproduce the bug?

  1. Start or open a Codex desktop thread.
  2. Have the assistant produce a message containing git directive-like text with a Windows cwd, for example:
::git-stage{cwd="P:\Codex\001_demo"}

or:

::git-commit{cwd="P:\Codex\001_demo"}
  1. The directive-like text does not need to be standalone. I also reproduced the issue when the assistant included it inside normal explanatory text, including inline code spans.
  2. Close the thread.
  3. Reopen the same thread from the sidebar.

Actual result:

The thread fails to render and shows an error page.

This does not appear to require actually executing git stage or git commit. The trigger appears to be the assistant message content containing directive-like text.

What is the expected behavior?

The reopened thread should render normally.

Assistant-emitted text that looks like git directive blocks should be treated as display content when rendering conversation history, or safely escaped/ignored by the renderer. It should not cause the entire thread to fail to render.

Additional information

Relevant logged error:

[electron-message-handler] error boundary
name=LocalConversationPage
errorMessage="invalid syntax at line 1 col 5:

1  cwd=\"P:\\Codex\\001_demo\"
       ^"

Relevant stack locations:

at Br (app://-/assets/markdown-D32gobzN.js:8:5425)
...
at Object.postMessage (app://-/assets/vscode-api-BEuchX0L.js:1:57272)
at Object.error (app://-/assets/vscode-api-BEuchX0L.js:1:57033)
at app://-/assets/review-file-source-tab-BmlwHNat.js:9:123182

View original on GitHub ↗

5 Comments

github-actions[bot] contributor · 3 months ago

Potential duplicates detected. Please review them and close your issue if it is a duplicate.

  • #22977
  • #22968
  • #22985
  • #22963

Powered by Codex Action

BearKouber · 3 months ago

This looks likely related to / possibly a duplicate of #22968.

One extra reproduction detail from my case: the directive-like text does not need to appear as standalone lines. I reproduced the desktop render failure when the assistant merely mentioned the strings inside a normal explanatory message, including inline code spans:

`::git-stage{cwd="P:\Codex\001_demo"}`
`::git-commit{cwd="P:\Codex\001_demo"}`
andrewD-github · 3 months ago

Just came here to lodge this :P (as created by codex).
I had to get claude to write some code to fix it ...now that is sad.

Additional confirmation from another Windows 10 install.

Environment:

  • Windows: Microsoft Windows NT 10.0.19045.0
  • Codex package version observed in install path: OpenAI.Codex_26.513.3673.0_x64
  • Installed app bundle inspected: app/resources/app.asar

I can confirm the issue is not only caused by an assistant accidentally writing directive-like text. The installed Codex app bundle itself appears to contain hard-coded developer instruction text telling the assistant to emit live git app directives after stage/commit/branch/push/PR actions.

Evidence from local inspection:

  • app.asar contains 6 references to the live git directive prefix.
  • The bundle also contains git directive instruction strings for stage, commit, push, branch creation, and PR creation.
  • These instructions are persisted into session JSONL as turn_context.developer_instructions.
  • On resume/new turn, this can reintroduce the same live directive prefix into a thread even after manually repairing old assistant messages.

Observed renderer failure:

[electron-message-handler] error boundary
name=LocalConversationPage
errorMessage="invalid syntax at line 1 col 5:

1  cwd=\"C:\\Users\\<user>\\Documents\\<repo>\"
       ^"
ermaxinc · 3 months ago

Temporary workaround for Windows users until Codex ships a fix.

The issue seems to be caused by Codex Desktop re-parsing old local JSONL session messages that contain directive-like blocks with Windows paths, for example cwd="D:\project\repo". The thread data is still there, but the Desktop renderer crashes while rendering the history.

This PowerShell one-liner does a narrow local repair:

  • scans %USERPROFILE%\.codex\sessions and %USERPROFILE%\.codex\archived_sessions
  • only touches JSONL session files
  • creates .bak-pathfix-<timestamp> backups before editing
  • only normalizes Windows path separators inside directive attributes named cwd, cwds, or file
  • converts D:\foo\bar to D:/foo/bar
  • does not delete, truncate, or rewrite the conversation content otherwise

_Run from PowerShell:_

taskkill /F /IM Codex.exe 2>$null; $ts=Get-Date -Format 'yyyyMMdd-HHmmss'; $roots=@("$env:USERPROFILE\.codex\sessions","$env:USERPROFILE\.codex\archived_sessions")|?{Test-Path $_}; $rx='(?<a>\b(?:cwd|cwds|file)=\\?"?)(?<v>(?:[A-Za-z]:|\\\\)[^"\\]*(?:\\+[^"\\]*)*)(?<q>\\?")'; Get-ChildItem $roots -Recurse -File -Filter '*.jsonl' -ErrorAction SilentlyContinue | % {$p=$_.FullName; $s=[IO.File]::ReadAllText($p); $n=([regex]::Matches($s,$rx)).Count; if($n -gt 0){Copy-Item $p "$p.bak-pathfix-$ts"; $s=[regex]::Replace($s,$rx,{param($m) $m.Groups['a'].Value + ($m.Groups['v'].Value -replace '\\+','/') + $m.Groups['q'].Value}); [IO.File]::WriteAllText($p,$s,[Text.UTF8Encoding]::new($false)); "fixed=$n file=$p"}}
etraut-openai contributor · 3 months ago

We've issued a hotfix to address this. Please update to the latest version.