Skip to content

Codex Desktop on Windows cannot reopen sessions after git actions due to unescaped Windows paths in git directives #23046

Closed

Description

@lvmaple

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.

Activity

  1. added
    appIssues related to the Codex desktop app
    on May 16, 2026
  2. added
    bugSomething isn't working
    windows-osIssues related to Codex on Windows systems
    sessionIssues involving session (thread) management, resuming, forking, naming, archiving
    on May 16, 2026
  3. etraut-openai commented on May 16, 2026

    @etraut-openai
    Contributor

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    appIssues related to the Codex desktop appbugSomething isn't workingsessionIssues involving session (thread) management, resuming, forking, naming, archivingwindows-osIssues related to Codex on Windows systems

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions