Skip to content

Resume is slow for large legacy sessions due to duplicate full-history processing #38349

Open

Description

@rebroad

Problem

Resuming some large legacy sessions can take 10–20 seconds or more from selecting the session in the resume picker to a usable composer.

I added temporary timing instrumentation to a local fork and observed the following for one legacy session:

  • 18,795 persisted rollout items and about 219 turns
  • Server history reconstruction: 7.9 seconds
  • Client initial transcript hydration: 4.9 seconds
  • Complete client bootstrap: 14.7 seconds
  • Configuration loading and thread creation were comparatively small (tens to hundreds of milliseconds)

The client requests excludeTurns=true, but the server still reconstructs the full legacy history to initialize the resumed model. The client then separately reads and hydrates the transcript for display, so the same large history is effectively processed twice before the composer is ready.

Suggested improvements

These are proposals based on the timings above; I have not implemented or tested them yet. I will update this issue after testing them in my fork.

  1. Keep the full history available to the resumed model, but return/display only a bounded initial transcript page.
  2. Make older legacy transcript content load lazily when the user scrolls upward.
  3. Reuse the server-side parsed history or an indexed/projection representation instead of reparsing the same rollout for client display.
  4. Migrate legacy rollouts to the paginated/thread-store representation in the background, or maintain a durable parsed/indexed projection.

The first improvement should reduce time-to-ready most directly, while the latter options should reduce the server-side parsing cost.

Environment

This was observed with a local amended build based on Codex alpha code. The measurements came from /home/.../.codex/logs_2.sqlite; no user prompt contents are included here.

Activity

  1. added
    bug
    app
    session
    on Aug 13, 2026
  2. github-actions commented on Aug 13, 2026

    @github-actions
    Contributor

    Potential duplicates detected. Please review them and close your issue if it is a duplicate.

    Powered by Codex Action

  3. boombx403-byte commented on Aug 18, 2026

    @boombx403-byte

    Hi @rebroad, the frozen history/resume behavior you described is one of the persistence patterns I've been studying. Codex Rescue Alpha5 includes a read-only projection consistency check that compares canonical rollout progress against stored projection cursors without touching SQLite.

    If you still have the affected pre-repair session locally, you can test it with:

    pip install codex-rescue==0.1.0a5
    codex-rescue doctor --latest --json

    (or point doctor directly to the rollout file). Please sanitize/redact any sensitive paths or names before sharing diagnostic output; raw session files are never needed.

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

    appbugperformancesession

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions