Skip to content

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

Open

Description

@wenqifu

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.

  5. 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:

fn thread_resume_params_from_config(
config: Config,
thread_id: ThreadId,
thread_params_mode: ThreadParamsMode,
remote_cwd_override: Option<&std::path::Path>,
model_settings: ResumeModelSettings,
) -> ThreadResumeParams {
let permissions = permissions_selection_from_config(&config, thread_params_mode);
let sandbox = permissions
.is_none()
.then(|| {
sandbox_mode_from_permission_profile(
&config.permissions.effective_permission_profile(),
config.cwd.as_path(),
)
})
.flatten();
let mut config_overrides = config_request_overrides_from_config(&config);
if model_settings == ResumeModelSettings::RestoreFromThread
&& let Some(overrides) = config_overrides.as_mut()
{
overrides.remove("model_reasoning_effort");
if overrides.is_empty() {
config_overrides = None;
}
}
let (model, model_provider) = match model_settings {
ResumeModelSettings::OverrideFromCurrentConfig => (
config.model.clone(),
thread_params_mode.model_provider_from_config(&config),
),
ResumeModelSettings::RestoreFromThread => (None, None),
};
ThreadResumeParams {
thread_id: thread_id.to_string(),
model,
model_provider,
service_tier: service_tier_override_from_config(&config),
cwd: thread_cwd_from_config(&config, thread_params_mode, remote_cwd_override),
runtime_workspace_roots: Some(config.workspace_roots.clone()),
approval_policy: Some(config.permissions.approval_policy.value().into()),
approvals_reviewer: approvals_reviewer_override_from_config(&config),
sandbox,
permissions,
config: config_overrides,
developer_instructions: with_terminal_visualization_instructions(
&config, /*control_instructions*/ None,
),
..ThreadResumeParams::default()
}

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.

Activity

  1. added
    enhancementNew feature or request
    CLIIssues related to the Codex CLI
    TUIIssues related to the terminal user interface: text input, menus and dialogs, and terminal display
    sessionIssues involving session (thread) management, resuming, forking, naming, archiving
    windows-osIssues related to Codex on Windows systems
    on Jul 22, 2026
  2. cowwoc commented on Jul 22, 2026

    @cowwoc

    Per #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.

  3. cowwoc commented on Jul 29, 2026

    @cowwoc

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

  4. cowwoc commented on Aug 7, 2026

    @cowwoc

    This issue is still reproducible in version 0.147.0

  5. 92645417d9e5c763259dbebc306e3e commented on Aug 7, 2026

    @92645417d9e5c763259dbebc306e3e
  6. cowwoc commented on Aug 7, 2026

    @cowwoc

    @92645417d9e5c763259dbebc306e3e Care to elaborate?

    Does this fix or help mitigate this bug somehow?

  7. 92645417d9e5c763259dbebc306e3e commented on Aug 7, 2026

    @92645417d9e5c763259dbebc306e3e

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

  8. cowwoc commented on Aug 8, 2026

    @cowwoc

    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?

  9. etraut-openai commented on Aug 12, 2026

    @etraut-openai
    Contributor

    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.

  10. AlgebraLoveme commented on Aug 19, 2026

    @AlgebraLoveme

    confirm solved by updating.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    CLIIssues related to the Codex CLITUIIssues related to the terminal user interface: text input, menus and dialogs, and terminal displayenhancementNew feature or requestperformancesessionIssues involving session (thread) management, resuming, forking, naming, archivingwindows-osIssues related to Codex on Windows systems

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions