codex - 💡(How to fix) Fix Codex App automation/heartbeat repeatedly fails to resume a running thread on Windows because the same session JSONL path is compared with and without the extended path prefix. [1 comments, 2 participants]

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…
GitHub stats
openai/codex#20517Fetched 2026-05-01 05:42:15
View on GitHub
Comments
1
Participants
2
Timeline
5
Reactions
0
Author
Timeline (top)
labeled ×4commented ×1

Error Message

Error: Observed error: If the target thread is still actively running, Codex should either wait, skip the overlapping heartbeat gracefully, or report that the previous run is still active. It should not permanently stop or fail the automation with a mismatched-path error for equivalent paths. I attached a screenshot of the error message.

Root Cause

Codex App automation/heartbeat repeatedly fails to resume a running thread on Windows because the same session JSONL path is compared with and without the extended path prefix.

RAW_BUFFERClick to expand / collapse

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

26.429.20946

What subscription do you have?

Pro x20

What platform is your computer?

Microsoft Windows NT 10.0.26200.0 x64

What issue are you seeing?

Codex App automation/heartbeat repeatedly fails to resume a running thread on Windows because the same session JSONL path is compared with and without the extended path prefix.

Error: cannot resume running thread 019ddff0-80cb-7f42-8317-8daf17d0bd7f with mismatched path: requested 'C:\Home.codex\sessions\2026\05\01\rollout-2026-05-01T04-49-34-019ddff0-80cb-7f42-8317-8daf17d0bd7f.jsonl', active '\?\C:\Home.codex\sessions\2026\05\01\rollout-2026-05-01T04-49-34-019ddff0-80cb-7f42-8317-8daf17d0bd7f.jsonl'

Expected: These paths should be canonicalized as the same file before comparing active vs requested session path.

Impact: Codex App automations/heartbeats stop frequently. This has happened dozens of times over the last 3 days.

Environment: Windows Codex Desktop CLI version seen in session logs: 0.126.0-alpha.8 Automation type: heartbeat

What steps can reproduce the bug?

This is intermittent, but I have been able to trigger it repeatedly with Codex App heartbeat automations on Windows, especially when the heartbeat interval is short (for example 1 minute) and the previous heartbeat run is still active or has only just finished.

Steps to reproduce:

  1. On Windows, create a Codex App heartbeat automation attached to an existing local thread.
  2. Set the heartbeat interval to a short RRULE, for example: FREQ=MINUTELY;INTERVAL=1
  3. Let the heartbeat perform a task that can take longer than the interval, or close/reopen/resume the app while the heartbeat thread is active.
  4. Wait for the next heartbeat to fire against the same target thread.
  5. The automation sometimes fails to resume the thread with a path mismatch, even though both paths refer to the same JSONL session file.

Observed error:

cannot resume running thread 019ddff0-80cb-7f42-8317-8daf17d0bd7f with mismatched path: requested 'C:\Home.codex\sessions\2026\05\01\rollout-2026-05-01T04-49-34-019ddff0-80cb-7f42-8317-8daf17d0bd7f.jsonl', active '\?\C:\Home.codex\sessions\2026\05\01\rollout-2026-05-01T04-49-34-019ddff0-80cb-7f42-8317-8daf17d0bd7f.jsonl'

Expected behavior:

Codex should canonicalize Windows paths before comparing the requested session path with the active session path. In this case, C:\Home\... and \\?\C:\Home\... are the same file, so the resume should not fail only because one path has the extended-length prefix.

Actual behavior:

The heartbeat automation stops/fails because the active running thread path and requested path are treated as different. This has happened dozens of times over the last ~3 days.

Session id from the example above:

019ddff0-80cb-7f42-8317-8daf17d0bd7f

Notes:

This seems more likely when the heartbeat interval is shorter than the duration of the previous run. Increasing the interval from 1-6 minutes to 20-30 minutes reduces the frequency, but does not address the underlying path normalization issue.

I do not have a minimal standalone code snippet, but the core comparison issue is equivalent to treating these two Windows paths as unequal:

requested = "C:\Home\.codex\sessions\2026\05\01\rollout-2026-05-01T04-49-34-019ddff0-80cb-7f42-8317-8daf17d0bd7f.jsonl" active = "\\?\C:\Home\.codex\sessions\2026\05\01\rollout-2026-05-01T04-49-34-019ddff0-80cb-7f42-8317-8daf17d0bd7f.jsonl"

These should be normalized/canonicalized before comparison.

What is the expected behavior?

Expected behavior:

Codex App should treat Windows paths that refer to the same session JSONL file as equivalent before comparing the requested session path with the active running thread path.

In particular, these two paths should be canonicalized to the same file:

C:\Home.codex\sessions\2026\05\01\rollout-2026-05-01T04-49-34-019ddff0-80cb-7f42-8317-8daf17d0bd7f.jsonl \?\C:\Home.codex\sessions\2026\05\01\rollout-2026-05-01T04-49-34-019ddff0-80cb-7f42-8317-8daf17d0bd7f.jsonl

A heartbeat automation should not fail to resume a thread solely because one path includes the Windows extended-length prefix (\\?\) and the other does not.

If the target thread is still actively running, Codex should either wait, skip the overlapping heartbeat gracefully, or report that the previous run is still active. It should not permanently stop or fail the automation with a mismatched-path error for equivalent paths.

Additional information

I attached a screenshot of the error message.

The key detail in the screenshot is that the requested path and active path point to the same session JSONL file, but one uses the normal Windows path form and the other uses the extended-length path prefix:

requested: C:\Home.codex\sessions\2026\05\01\rollout-2026-05-01T04-49-34-019ddff0-80cb-7f42-8317-8daf17d0bd7f.jsonl

active: \?\C:\Home.codex\sessions\2026\05\01\rollout-2026-05-01T04-49-34-019ddff0-80cb-7f42-8317-8daf17d0bd7f.jsonl

This has happened repeatedly over the last few days with heartbeat automations.

<img width="729" height="152" alt="Image" src="https://github.com/user-attachments/assets/a2c51c97-4c54-4c09-b099-7ffecc700717" />

extent analysis

TL;DR

The issue can be resolved by canonicalizing Windows paths before comparing the requested session path with the active session path, ensuring that paths with and without the extended-length prefix are treated as equivalent.

Guidance

  • Verify that the issue is indeed caused by the path comparison by checking the session logs for the exact error message and confirming that the requested and active paths point to the same file.
  • Consider increasing the heartbeat interval to reduce the frequency of the issue, although this does not address the underlying path normalization problem.
  • To fix the issue, the Codex App should be modified to normalize Windows paths before comparison, handling the extended-length prefix (\\?\) correctly.
  • Test the fix by running the heartbeat automation with a short interval and verifying that the thread resumes correctly even when the previous run is still active or has just finished.

Example

No code snippet is provided, but the comparison issue can be illustrated with the following example:

import os

requested = r"C:\Home\.codex\sessions\2026\05\01\rollout-2026-05-01T04-49-34-019ddff0-80cb-7f42-8317-8daf17d0bd7f.jsonl"
active = r"\\?\C:\Home\.codex\sessions\2026\05\01\rollout-2026-05-01T04-49-34-019ddff0-80cb-7f42-8317-8daf17d0bd7f.jsonl"

# Normalize the paths before comparison
normalized_requested = os.path.normpath(requested)
normalized_active = os.path.normpath(active.replace(r"\\?\\", ""))

if normalized_requested == normalized_active:
    print("Paths are equivalent")
else:
    print("Paths are not equivalent")

Notes

The provided solution assumes that the issue is indeed caused by the path comparison and that

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

codex - 💡(How to fix) Fix Codex App automation/heartbeat repeatedly fails to resume a running thread on Windows because the same session JSONL path is compared with and without the extended path prefix. [1 comments, 2 participants]