Codex Desktop renderer crashes when transcript contains git directive with raw Windows cwd path

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

Codex Desktop renderer crashes when transcript contains git directive with raw Windows cwd path

Summary

Codex Desktop on Windows can make a thread unusable when a rendered transcript contains a Codex git app directive with a raw Windows cwd path. The affected thread opens to the generic "Oops, an error has occurred" screen. The underlying session JSONL remains valid JSON; the failure appears to happen in the Desktop renderer while interpreting historical transcript text as an app directive.

Environment

  • Product: Codex Desktop
  • OS: Windows
  • CLI version recorded in session metadata: 0.131.0-alpha.9
  • Affected local state root: C:\Users\Scott\.codex

What Happened

  1. A prior assistant response included Codex git action directive text in the final answer.
  2. The directive contained a raw Windows path in the cwd attribute.
  3. Reopening the thread in Codex Desktop caused the main pane to show "Oops, an error has occurred".
  4. A follow-up investigation thread reproduced the crash by quoting the dangerous directive text as evidence.
  5. The same visible assistant answer was stored in multiple renderable JSONL records, so repairing only one occurrence was not enough.

Important Safety Note For This Report

I am intentionally not spelling the exact directive marker in this issue body because including it literally inside another Codex transcript reproduced the crash. The dangerous shape is:

[Codex git directive marker]git-<action>{cwd="<Windows drive path>", ...}

Where <Windows drive path> begins like:

C:\Users\...

The local repair script detects the exact marker internally without writing the literal marker in normal prose.

Evidence

A local findings document was created at:

C:\Users\Scott\.codex\CodexUiDirectiveCrashFindings.md

It records:

  • The original broken thread id: 019e30e1-667e-7432-a4d2-2f0a7eec3a61
  • The repeat investigation thread id: 019e3103-d376-7843-9cb4-13c79e97f3b7
  • The documentation thread id: 019e310b-1a0c-7d82-9e67-5dd09ab925ee
  • The affected rollout JSONL files under C:\Users\Scott\.codex\sessions\2026\05\16
  • The observation that the same assistant content can be stored as agent_message, visible assistant message, and task_complete
  • The conclusion that this is not JSONL truncation; the files parsed successfully after repair

Local Repair That Worked

A local repair script was created at:

C:\Users\Scott\.codex\Repair-CodexDirectiveCrash.ps1

The repair:

  • Scans session JSONL files for the crash-signature directive plus Windows-drive cwd.
  • Makes timestamped backups beside the original files.
  • Replaces only the directive marker prefix with neutral text.
  • Re-parses repaired JSONL line by line.
  • Runs SQLite integrity checks when sqlite3 is available.

After repair, the scan reported:

remaining_crash_signatures=0

The standalone script also reported:

No Codex git-directive Windows-cwd crash signatures found.
Scan only. Re-run with -Apply to repair matching session files.

Expected Behavior

Codex Desktop should not parse arbitrary rendered transcript text as trusted app directives. If directive-like text appears in assistant/user messages, code fences, command output, or docs, it should render as inert text.

If directive parsing is still required in historical records, the parser should safely reject malformed or unsupported attributes without crashing the thread view.

Actual Behavior

The thread becomes unusable in Codex Desktop and shows:

Oops, an error has occurred

Suggested Fix

  • Parse app directives only from trusted structured event records, not arbitrary rendered transcript text.
  • Treat directive-looking text inside markdown/code fences/tool output as inert.
  • Harden the directive parser for Windows paths in attribute values.
  • Fail closed per message/component instead of taking down the whole thread view.

Attachments / Local Files Available

Additional local files can be provided if needed.

View original on GitHub ↗

3 Comments

github-actions[bot] contributor · 3 months ago

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

  • #23025
  • #23010
  • #23004
  • #22977
  • #22968

Powered by Codex Action

oleginvoke · 3 months ago

Same issue.
I reproduced this:
Method:

  1. Extracted the installed Codex Desktop webview assets from app.asar.
  2. Imported the real markdown/directive parser export from:

app-server-manager-signals-BEaGjuc8.js

  1. Called the parser in Node with a few in-memory directive-shaped strings.
  2. Also loaded the saved final assistant message from the previously broken local session JSONL.

Observed result:

  • A cwd attribute value equal to C: parses successfully.
  • Any backslash in the cwd attribute value causes:

invalid syntax at line 1 col 5

  • The same directive shape with forward slashes parses successfully.
  • The saved final answer from the broken PR thread fails with the same parser error.
  • If I normalize only the path separators in that saved final answer from \ to /, the parser succeeds and finds all five git-action directives.

Environment:

  • Product: Codex Desktop
  • Package: OpenAI.Codex_26.513.3673.0_x64__2p2nqsd0c76g0
  • App version reported by Sentry context: 26.513.31313
  • Runtime: Electron 42.0.1, Node 24.15.0
  • OS: Windows 10.0.19045 x64
  • Shell: PowerShell

Local evidence:

  • Repro script: C:\Users\oleg\AppData\Local\Temp\codex-repro-directive.mjs
  • Saved session that fails parser reproduction:

C:\Users\oleg\.codex\sessions\2026\05\16\rollout-2026-05-16T23-06-14-019e31f7-a74a-7a60-aa67-98b8211d421a.jsonl

  • Sentry scope file with matching renderer stack:

C:\Users\oleg\AppData\Roaming\Codex\sentry\scope_v3.json

Relevant stack frames seen in local Sentry data:

  • app-server-manager-signals-BEaGjuc8.js
  • marked.esm-B1dI5d9h.js
  • markdown-D32gobzN.js
  • local-conversation-thread-BKrlVhAv.js

The failure appears to be in the Codex Desktop markdown/directive parser for directive attributes containing raw Windows backslashes, not in Gitea MCP or PR creation itself.

etraut-openai contributor · 3 months ago

We've released a hotfix that addresses this issue. Please update to the new version.