Skip to content

Conversation

@jdsalasca
Copy link
Contributor

@jdsalasca jdsalasca commented Jan 20, 2026

Fixes #9501

Contributing guide: https://github.com/openai/codex/blob/main/docs/contributing.md

Summary

The resume picker requires a session_meta line and at least one user_message event within the initial head scan. Some rollout files contain multiple session_meta entries before the first user_message, so the user event can fall outside the default head window and the session is omitted from the picker even though it is resumable by ID.

This PR keeps the head summary bounded but extends scanning for a user_message once a session_meta has been observed. The summary still caps stored head entries, but we allow a small, bounded extra scan to find the first user event so valid sessions are not filtered out.

Changes

  • Continue scanning past the head limit (bounded) when session_meta is present but no user_message has been seen yet.
  • Mark session_meta as seen even if the head summary buffer is already full.
  • Add a regression test with multiple session_meta lines before the first user_message.

Why This Is Safe

  • The head summary remains bounded to avoid unbounded memory usage.
  • The extra scan is capped (USER_EVENT_SCAN_LIMIT) and only triggers after a session_meta is seen.
  • Behavior is unchanged for typical files where the user_message appears early.

Testing

  • cargo test -p codex-core --lib test_list_threads_scans_past_head_for_user_event

@github-actions
Copy link
Contributor

github-actions bot commented Jan 20, 2026

All contributors have signed the CLA ✍️ ✅
Posted by the CLA Assistant Lite bot.

@jdsalasca
Copy link
Contributor Author

I have read the CLA Document and I hereby sign the CLA

github-actions bot added a commit that referenced this pull request Jan 20, 2026
@jdsalasca jdsalasca force-pushed the fix/resume-picker-user-event-scan branch from bdd0914 to 5c62451 Compare January 20, 2026 03:09
@etraut-openai
Copy link
Collaborator

@codex review

@chatgpt-codex-connector
Copy link
Contributor

Codex Review: Didn't find any major issues. Already looking forward to the next diff.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@aibrahim-oai aibrahim-oai merged commit e0ae219 into openai:main Jan 23, 2026
26 of 32 checks passed
@github-actions github-actions bot locked and limited conversation to collaborators Jan 23, 2026
@etraut-openai
Copy link
Collaborator

@jdsalasca, thanks for the contribution!

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

codex resume --all picker omits a session that can be resumed by ID

3 participants