openai / openai/codex

Codex cannot resume paginated subagent thread: ordinal 7675 exists but final durable ordinal is 7674

Open
#44,524 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

app bug session subagent
Dominant language
Rust
Stars
125k
Forks
19.4k
PR merge metrics
PR metrics pending

Description

Bug report: paginated subagent resume rejects existing trailing token_count ordinal

Observed failure

An existing local thread cannot resume. Logs from 2026-09-10 show:

2026-09-10T11:48:06.418Z error [electron-message-handler]
method=thread/resume
error code=-32603
error resuming thread: Fatal error: Failed to initialize session: thread-store internal error: failed to resume local thread recorder: paginated subagent rollout at <LOCAL_SESSION_PATH> is incomplete: expected inherited prefix through ordinal 7675, found final durable ordinal 7674

The same error is recorded at 2026-09-10T12:55:15.808Z. Local username and full filesystem path have been removed from this excerpt. No conversation content or CV data is included.

Read-only validation

  • File size: 79,513,143 bytes.
  • 7,676 JSONL lines; every line parses successfully.
  • Top-level ordinals are exactly 0 through 7675, with no gaps or duplicates.
  • The file ends with a newline; no truncated final record.
  • Original and backup hashes match before and after inspection.
  • SHA-256: fa7e30832a88be5f1a1e3859ba572ac480382a3eb35e21dfba6ea150522b3080
  • Session metadata: cli_version=0.146.0-alpha.9.2 (recorded creator version, not verified current runtime version), thread_source=subagent, history_mode=paginated, subagent_history_start_ordinal=7676.

Tail structure

[
  {"ordinal":7673,"type":"response_item","payload_type":"custom_tool_call"},
  {"ordinal":7674,"type":"response_item","payload_type":"custom_tool_call_output"},
  {"ordinal":7675,"type":"event_msg","payload_type":"token_count"}
]

This is a structural summary, not fabricated replacement records. The actual ordinal 7675 has a complete token_count payload and no explicit durable:false or non-durable flag.

Expected versus actual

Expected: resuming should consistently validate the inherited boundary when the complete final inherited record is present on disk.
Actual: the loader requires prefix through 7675 but reports final durable ordinal 7674.

Hypothesis, not source-code-confirmed: token_count is excluded from the durable tail calculation while subagent_history_start_ordinal includes it, causing a boundary mismatch. Please investigate the paginated subagent rollout reader and provide a supported recovery path preserving conversation history.

No source files, backup files, ordinals or session metadata were modified. No attempt was made to invent a missing record or bypass the validator.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Locate the paginated subagent rollout reader and the durable-tail calculation, then inspect how the subagent_history_start_ordinal boundary handles the final token_count record. Reproduce the resume failure with the described local thread structure and verify a supported recovery path that preserves the conversation history and accepts a complete inherited boundary.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
backend, tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.