Feature request: shard and lazily load long Codex sessions after compaction

Resolved 💬 1 comment Opened May 11, 2026 by olet Closed May 12, 2026

What version of the Codex App are you using (From “About Codex” dialog)?

26

What subscription do you have?

pro

What platform is your computer?

win

What issue are you seeing?

Feature request: shard and lazily load long Codex sessions after compaction

Problem:
Long Codex Desktop sessions can become very slow or freeze. After a session has been compacted, older raw transcript content is usually no longer needed in active model context. Its main remaining value is occasional user backscroll / audit / recovery. Keeping the full pre-compaction transcript parsed, rendered, or resident in memory makes long-running sessions unstable.

Additional observed behavior:

In Codex Desktop 26.506.31421 on Windows, once a session becomes very long, even basic controls become sluggish. Clicking Send or Stop does not respond immediately; the UI freezes or stalls for a while before the action is reflected.

This suggests the problem is not only model latency or context size. The main window/event loop appears to be doing too much work over the accumulated session history, likely from keeping old transcript/render state hot or reprocessing too much session data during user actions.

The desired behavior is that Send/Stop should remain responsive regardless of total historical session length. After compaction, pre-compaction raw history should be cold backscroll data, not part of the hot UI/runtime state.

Requested behavior:
After compaction, Codex should treat earlier raw history as cold history, not hot context.

Suggested design:

  1. Keep appending to the canonical rollout JSONL for durability.
  2. Build a shard manifest over the rollout file, e.g. json001.jsonl, json002.jsonl, etc.
  3. On session restore, load only:
  • session metadata
  • compaction summary
  • recent messages
  • shard index / manifest
  1. In the main conversation window, use virtualized scrolling.
  2. Hydrate old message ranges only when the user scrolls near them.
  3. Unload old hydrated ranges from memory when they leave the viewport.
  4. Never reinsert pre-compaction raw transcript into active model context unless explicitly requested for some recovery/debug flow.

Why this matters:
For long sessions, old transcript text is no longer active reasoning context after compaction. It should behave like paged storage, similar to chunked map loading in a game: visible nearby chunks stay hot, distant chunks stay on disk.

Expected result:

  • Long sessions remain responsive.
  • Backscroll still works.
  • Session files remain durable.
  • Memory usage is bounded by viewport/recent-context size rather than total transcript length.

What steps can reproduce the bug?

What is the expected behavior?

_No response_

Additional information

_No response_

View original on GitHub ↗

This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗