Skip to content

codex resume --last can start a fresh session even when codex resume picker can continue the intended thread #17302

@zio3

Description

@zio3

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    TUIIssues related to the terminal user interface: text input, menus and dialogs, and terminal displaybugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions