codex - ✅(Solved) Fix codex resume --last can start a fresh session even when codex resume picker can continue the intended thread [1 pull requests, 6 comments, 3 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#17302Fetched 2026-04-11 06:18:15
View on GitHub
Comments
6
Participants
3
Timeline
13
Reactions
0
Author
Timeline (top)
commented ×6labeled ×3closed ×1cross-referenced ×1

Fix Action

Fixed

PR fix notes

PR #17414: Fix thread/list cwd filtering for Windows verbatim paths

Description (problem / solution / changelog)

Addresses #17302

Problem: thread/list compared cwd filters with raw path equality, so resume --last could miss Windows sessions when the saved cwd used a verbatim path form and the current cwd did not.

Solution: Normalize cwd comparisons through the existing path comparison utilities before falling back to direct equality, and add Windows regression coverage for verbatim paths. I made this a general utility function and replaced all of the duplicated instance of it across the code base.

Changed files

  • codex-rs/app-server/src/codex_message_processor.rs (modified, +4/-3)
  • codex-rs/core/src/config/service.rs (modified, +1/-8)
  • codex-rs/core/src/tools/runtimes/mod.rs (modified, +1/-8)
  • codex-rs/exec/src/lib.rs (modified, +1/-7)
  • codex-rs/rollout/src/recorder.rs (modified, +1/-7)
  • codex-rs/tui/src/lib.rs (modified, +1/-7)
  • codex-rs/tui/src/resume_picker.rs (modified, +1/-7)
  • codex-rs/utils/path-utils/src/lib.rs (modified, +13/-0)
  • codex-rs/utils/path-utils/src/path_utils_tests.rs (modified, +35/-0)
RAW_BUFFERClick to expand / collapse

What version of Codex is running?

codex-cli 0.118.0

What subscription do you have?

Plus

Which model were you using?

No response

What platform is your computer?

Windows

What issue are you seeing?

codex resume works as expected when I pick the intended prior session from the interactive picker, but codex resume --last starts what appears to be a fresh session instead of continuing that same session.

This does not look like an expected UX difference between picker mode and --last. From reading the open-source code, --last appears to apply additional filtering when resolving the latest session (for example cwd / source kind / model provider), and when that lookup fails the result is effectively a fresh session.

That makes resume --last behave very differently from what users usually expect from "resume the last session", especially when the plain resume picker can still find and continue the expected thread.

What steps can reproduce the bug?

  1. Start a Codex session in a repository / workspace.
  2. Exit Codex.
  3. Run codex resume, choose the most recent expected session from the picker, and confirm that it resumes correctly.
  4. Exit again.
  5. Run codex resume --last from the same environment.
  6. Observe that Codex starts what appears to be a fresh session instead of continuing the same thread.

What is the expected behavior?

codex resume --last should continue the same most recent session that a user would reasonably expect from the picker flow, or at minimum fail clearly instead of silently falling back to a fresh session.

Additional information

Related UX discussion: #4545

I think there are two separate concerns here:

  1. Bug: resume --last can behave like a fresh session even though the picker can still resume the intended thread.
  2. UX / semantics: users are likely to interpret --last as "resume the globally latest session" rather than "resume the latest session matching hidden filters".

Even if the filtering is intentional, silently landing in a fresh session seems wrong.

extent analysis

TL;DR

The issue can be mitigated by using the interactive picker instead of --last flag until the filtering logic for codex resume --last is revised to match user expectations.

Guidance

  • Verify that the issue is not specific to the current repository or workspace by testing codex resume --last in a different environment.
  • Check the documentation for codex resume --last to see if the filtering behavior is intended and if there are any workarounds or additional flags that can be used to achieve the desired behavior.
  • Consider participating in the related UX discussion (#4545) to provide feedback on the expected behavior of codex resume --last.
  • Test if providing additional parameters (e.g., --cwd, --source-kind, --model-provider) with codex resume --last can help to resume the intended session.

Notes

The issue seems to be related to the filtering logic used by codex resume --last, which may not match the user's expectations. The problem may be specific to the current version of Codex (0.118.0) and the Plus subscription.

Recommendation

Apply workaround: use the interactive picker instead of --last flag, as it allows users to select the intended session and resume it correctly. This approach ensures that users can continue their work without interruptions until the filtering logic for codex resume --last is revised.

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