[CLI/TUI] Resume renders the full thread history instead of bootstrapping the latest turn

Open 💬 9 comments Opened Jul 22, 2026 by wenqifu
💡 Likely answer: A maintainer (etraut-openai, contributor) responded on this thread — see the highlighted reply below.

What version of Codex CLI is running?

Reproduced on codex-cli 0.145.0 (also observed on 0.144.6).

What subscription do you have?

ChatGPT subscription (exact tier not disclosed).

Which model were you using?

gpt-5.6-sol

What platform is your computer?

Windows 11 Professional, build 10.0.26200, x64.

What terminal emulator and version are you using?

Windows Terminal 1.24.11911.0, PowerShell, no terminal multiplexer.

Codex doctor report

Fresh codex doctor --json result, summarized to exclude local paths, user
names, thread identifiers, and private configuration details:

  • standalone Windows installation;
  • CLI 0.145.0;
  • Windows Terminal detected;
  • config load and rollout/database parity both healthy;
  • overall status ok and current version not older than the latest release.

What issue are you seeing?

Resuming a long Codex CLI thread in the TUI visibly rebuilds the entire previous
conversation before reaching the prompt. Multi-day sessions therefore spend
noticeable time replaying old turns and produce a long scrolling sequence, even
though only the most recent completed turn is needed for the initial human-facing
view.

The desired behavior is display truncation, not history deletion: keep the full
rollout and full model continuity, but show only the latest completed
user/assistant turn in the TUI. The terminal does not need an older-history
expansion interface; if prior context matters, the user can ask Codex directly.

What steps can reproduce the bug?

  1. Create or use a Codex CLI thread with several large turns over multiple days.
  2. Close the TUI normally.
  3. In Windows Terminal, run codex resume <thread-id>.
  4. Observe that the TUI renders/replays the historical turns before settling at

the current prompt.

  1. Compare the app-server resume paths for the same stored thread:
  • default thread/resume returns the full thread.turns payload;
  • thread/resume with excludeTurns: true and

initialTurnsPage: {limit: 1, sortDirection: "desc", itemsView: "full"}
returns only the newest turn page for a legacy thread.

Private thread identifiers and transcript contents are intentionally omitted.

What is the expected behavior?

On resume, the TUI should become interactive after rendering only the latest
completed turn. Older turns should not be rendered in the terminal. The complete
conversation should remain stored and remain available to Codex as model context,
so the user can ask Codex for earlier context when needed. Resuming must not
truncate, compact, rewrite, or replace the rollout.

Additional information

One legacy rollout was 6,046,582 bytes and contained eight reconstructed turns.
Elapsed time is from one local trial and is not intended as a stable performance
claim.

| CLI | Resume path | Time | Response bytes | Returned turns |
|---|---|---:|---:|---:|
| 0.144.6 | Default full resume | 1.176 s | 509,897 | 8 |
| 0.144.6 | One-turn page | 0.931 s | 29,672 | 1 |
| 0.145.0 | Default full resume | 1.860 s | 510,100 | 8 |
| 0.145.0 | One-turn page | 0.174 s | 29,875 | 1 |

On 0.145.0, the one-turn request reduced response data by about 94.1% and
elapsed time by about 90.6% in this single trial. The rollout SHA-256, file
size, and modification time were identical before the upgrade and after both
requests. The active session count also remained unchanged.

The app-server already documents excludeTurns, initialTurnsPage, and cursor
pagination:

<https://github.com/openai/codex/blob/main/codex-rs/app-server/README.md>

At the rust-v0.145.0 release commit, the TUI's
thread_resume_params_from_config constructs ThreadResumeParams and finishes
with ..ThreadResumeParams::default(). That leaves exclude_turns = false and
initial_turns_page = None, so the terminal client requests the full legacy
history:

<https://github.com/openai/codex/blob/25af12f7e61572b0bc18ddb1008be543b91519b0/codex-rs/tui/src/app_server_session.rs#L1539-L1588>

Suggested acceptance criteria

  1. Resume a large legacy thread without rendering every historical turn first.
  2. Show the latest completed user/assistant turn at bootstrap.
  3. Do not add an older-history expansion requirement to the terminal view.
  4. Preserve the original rollout byte-for-byte during a display-only resume.
  5. Preserve the full model-visible thread context.
  6. Let the user recover earlier context by asking Codex naturally.
  7. Add a TUI regression test asserting one-turn bootstrap history.

View original on GitHub ↗

9 Comments

cowwoc · 1 month ago

Per https://github.com/openai/codex/issues/34776 /agent is impacted as well. I am seeing an 8 minute delay when using session resume, or /agent when using 0.145.0 vs 0.144.6.

cowwoc · 1 month ago

This issue is still reproducible in version 0.146.0. It's pretty crazy that no one in OpenAI has noticed this yet...

cowwoc · 20 days ago

This issue is still reproducible in version 0.147.0

92645417d9e5c763259dbebc306e3e · 20 days ago
cowwoc · 20 days ago

@92645417d9e5c763259dbebc306e3e Care to elaborate?

Does this fix or help mitigate this bug somehow?

92645417d9e5c763259dbebc306e3e · 20 days ago

This tool can convert the old jsonl format to the new pagination format, this solving the loading speed problem

cowwoc · 20 days ago

I asked Codex to research the change and the underlying session resume mechanism and it disagrees.

While it is true that codex migrate-rollouts --apply rewrites legacy JSONL into paginated format and materializes SQLite history rollout_migration.rs, the app-server documentation says paginated threads retain the same behavior: a default resume still materializes the full history; pagination requires excludeTurns: true and/or initialTurnsPage. README.md An actual fix would need to change the TUI’s resume parameters, likely to excludeTurns: true plus a one-turn initialTurnsPage.

Have you tested what you suggested or was this an assumption?

etraut-openai contributor · 16 days ago

This should feel much better as of 0.148.0. We've added support for "paginated threads", which allows clients to request groups of turns rather than the entire thread.

AlgebraLoveme · 8 days ago

confirm solved by updating.