codex - 💡(How to fix) Fix Codex Desktop on Windows cannot reopen sessions after git actions due to unescaped Windows paths in git directives

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

Local logs / renderer error showed a parser failure similar to: Error: invalid syntax at line 1 col 5: 1 cwd="D:\path\to\repo"

Fix Action

Fix / Workaround

Workaround:

RAW_BUFFERClick to expand / collapse

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

Codex 26.513.31313

What subscription do you have?

plus

What platform is your computer?

Microsoft Windows NT 10.0.22631.0 x64

What issue are you seeing?

Codex Desktop on Windows cannot reopen some historical conversations after Codex performs git actions.

The affected conversations fail to restore from history. In some cases the app shows a popup similar to:

Failed to restore conversation

cannot resume running thread <thread-id> with stale path:
requested 'C:\Users\<user>\.codex\sessions\<date>\rollout-<timestamp>-<thread-id>.json',
active '\\?\C:\Users\<user>\.codex\sessions\<date>\rollout-<timestamp>-<thread-id>.jsonl'

In other cases, there is no popup, but clicking the historical conversation does not open it.

Local logs / renderer error showed a parser failure similar to:

Error: invalid syntax at line 1 col 5: 1 cwd="D:\path\to\repo"

Local investigation found persisted git action directives in the session JSONL containing raw Windows backslash paths, for example:

::git-create-branch{cwd="D:\path\to\repo" branch="codex/example"}
::git-stage{cwd="D:\path\to\repo"}
::git-commit{cwd="D:\path\to\repo"}
::git-push{cwd="D:\path\to\repo" branch="codex/example"}
::git-create-pr{cwd="D:\path\to\repo" branch="codex/example" url="https://github.com/<org>/<repo>/pull/1" isDraft=true}

After manually replacing those persisted ::git-*{cwd="D:\..."} records in the local session JSONL with plain text, the session JSONL parsed again and the affected conversations could be reopened.

This suggests that Codex Desktop is persisting git action directives with unescaped Windows paths, and later the markdown/directive parser fails when rendering the saved conversation.

What steps can reproduce the bug?

  1. Run Codex Desktop on Windows.

  2. Open a repo whose working directory is a normal Windows path, for example: D:\path\to\repo

  3. Ask Codex to perform a normal git workflow, for example:

    • create a branch
    • stage files
    • commit
    • push
    • create a PR
  4. Let the conversation finish.

  5. Reopen the same conversation from Codex Desktop history.

Actual result:

The conversation fails to reopen. Sometimes Codex shows a resume failure popup. Other times there is no popup, but the historical thread still does not open.

Local investigation:

The affected session JSONL contained persisted git action directives with raw Windows backslash paths, for example:

::git-create-branch{cwd="D:\path\to\repo" branch="codex/example"}
::git-stage{cwd="D:\path\to\repo"}
::git-commit{cwd="D:\path\to\repo"}
::git-push{cwd="D:\path\to\repo" branch="codex/example"}
::git-create-pr{cwd="D:\path\to\repo" branch="codex/example" url="https://github.com/example/repo/pull/1" isDraft=true}

These lines appear to break the markdown/directive parser when Codex Desktop renders the saved conversation again.

Workaround:

Manually replacing the persisted ::git-*{cwd="D:\..."} lines in the local session JSONL with plain text allowed the session to parse again and reopen.

What is the expected behavior?

Codex Desktop should reopen historical conversations normally after git actions such as creating a branch, staging, committing, pushing, or creating a PR.

Git action records should not make a session unreopenable on Windows. If Codex persists git metadata in history, Windows paths in directive attributes should be safely escaped, normalized, or stored as structured metadata that does not get reparsed as invalid markdown/directive syntax.

A malformed historical directive should fail softly or be ignored, rather than preventing the entire conversation from opening.

Additional information

The affected session files were still valid JSONL. The failure appears to happen when Codex Desktop renders the saved conversation and reparses persisted ::git-* directive text.

This suggests the restore path should fail softly on malformed historical directives, so one bad directive does not prevent the entire conversation from opening.

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