codex - 💡(How to fix) Fix /side, /fork, backtrack in very long sessions are linearly-in-jsonl slow [2 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
openai/codex#19278Fetched 2026-04-24 10:39:27
View on GitHub
Comments
2
Participants
2
Timeline
6
Reactions
0
Author
Timeline (top)
labeled ×3commented ×2closed ×1

Root Cause

jsonl trimming also seems sensible. The reason I keep indefinite sessions is because a lot of implicit understanding gets baked deep into the context by your (amazing, I must add) compaction, and a cold reset always hurts -- but I don't care about preserving the infinite jsonl (or, in a perfect world, the truncated bit would be zstd+logrotated). Some sort of (auto) /trim would do wonders here.

RAW_BUFFERClick to expand / collapse

What version of Codex CLI is running?

0.124

What subscription do you have?

pro

Which model were you using?

gpt-5.5

What platform is your computer?

Linux 6.19.11-arch1-1 x86_64 unknown

What terminal emulator and version are you using (if applicable)?

alacritty 0.17.0 (94e7c887)

What issue are you seeing?

I hate resetting my sessions so I'm at about 15 billion tokens now.

/fork and /side now take about ~30 seconds. I assume some linear scan of the jsonl is happening, but this file is 1.5 GiB now and most of it is useless. Ctrl+L clears do not help with this.

There should perhaps be lookback limits to any operation that would otherwise scan the whole jsonl.

jsonl trimming also seems sensible. The reason I keep indefinite sessions is because a lot of implicit understanding gets baked deep into the context by your (amazing, I must add) compaction, and a cold reset always hurts -- but I don't care about preserving the infinite jsonl (or, in a perfect world, the truncated bit would be zstd+logrotated). Some sort of (auto) /trim would do wonders here.

What steps can reproduce the bug?

Have a very long session (3B+ to be noticeable) and do anything like /side, /fork or esc-esc rewind.

What is the expected behavior?

These operations are snappy.

Additional information

019db0a9-e8d4-70f1-9dd4-312efe80bcde

extent analysis

TL;DR

Implementing a lookback limit or jsonl trimming feature could improve performance by reducing the amount of data scanned during operations like /fork and /side.

Guidance

  • Consider introducing a lookback limit to restrict the amount of data scanned during operations, potentially improving performance.
  • Implementing jsonl trimming could help reduce the file size and improve overall system efficiency.
  • Investigate the feasibility of auto-trimming the jsonl file, potentially using zstd compression and log rotation.
  • Evaluate the trade-offs between preserving session context and maintaining performance, as indefinite sessions may be contributing to the issue.

Example

No code snippet is provided as the issue does not imply a specific code-based solution.

Notes

The issue is specific to the Codex CLI version 0.124 and the gpt-5.5 model, and may not be representative of other versions or models.

Recommendation

Apply a workaround, such as manually trimming the jsonl file or implementing a lookback limit, as the issue is likely related to the large file size and scanning operations.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING