Repository navigation
Codex session logs grow to 700MB-2GB from repeated compaction history and raw tool output #24948
Description
What version of Codex CLI is running?
0.118.0
What subscription do you have?
Pro
Which model were you using?
gpt-5.5
What platform is your computer?
Darwin 24.6.0 arm64 arm
What terminal emulator and version are you using (if applicable)?
codex-tui
Codex doctor report
What issue are you seeing?
Codex CLI/TUI is creating extremely large session JSONL files under ~/.codex/sessions.
One affected session file is 732 MB:
~/.codex/sessions/2026/03/31/rollout-2026-03-31T22-18-46-019d458c-752d-76c0-bbfa-a29eafa0cbf0.jsonl
A quick breakdown shows the size is dominated by repeated compaction history and raw tool outputs:
- 337.8 MB from
compactedrecords - 230.8 MB from
function_call_output - 54.8 MB from
reasoning - 26.4 MB from
token_countevents - 18.0 MB from
turn_context
The file has 170,415 JSONL records. The largest single record is about 2.1 MB. My ~/.codex/sessions directory is now about 91 GB total, with 184 JSONL files over 100 MB
and the largest observed file around 1.95 GB.
This looks like unbounded session logging / repeated persistence of compaction history rather than expected transcript storage.
What steps can reproduce the bug?
- Use Codex CLI/TUI for a long coding session with multiple tool calls.
- Run broad search commands that can produce large outputs, for example
rgacross large repos or/tmp. - Continue the session long enough for context compaction to occur multiple times.
- Inspect
~/.codex/sessions/YYYY/MM/DD/rollout-*.jsonl. - Check file size and record composition with commands like
du -h,wc -l, andjq.
Observed result:
The session JSONL grows to hundreds of MB or more. In one case, a single rollout file reached 732 MB with 170,415 records.
The biggest contributors were:
- repeated
compactedrecords containing largereplacement_historypayloads - raw
function_call_outputpayloads - reasoning and token count event records
What is the expected behavior?
Session logs should stay bounded and should not grow to hundreds of MB or multiple GB for a normal long coding session.
Expected behavior:
- Tool outputs should be truncated, summarized, deduplicated, or stored with a size cap.
- Context compaction should not repeatedly persist large prior history snapshots in
replacement_history. - Old session logs should be compressed or covered by a retention policy.
- A long tool-heavy session might produce a larger log, but it should remain within a reasonable size, not 700MB-2GB per JSONL file.
Additional information
Affected file:
~/.codex/sessions/2026/03/31/rollout-2026-03-31T22-18-46-019d458c-752d-76c0-bbfa-a29eafa0cbf0.jsonl
File stats:
- Size: 732 MB
- Lines: 170,415
- Largest single JSONL record: ~2.1 MB
- Average record size: ~4.5 KB
Breakdown by record type:
compacted: 337.8 MB across 684 recordsresponse_item/function_call_output: 230.8 MB across 35,368 recordsresponse_item/reasoning: 54.8 MB across 23,659 recordsevent_msg/token_count: 26.4 MB across 38,885 recordsturn_context: 18.0 MB across 955 recordsresponse_item/custom_tool_call: 16.3 MBresponse_item/function_call: 14.5 MB
Two large rg tool outputs in the affected session:
- ~1.9 MB output from an
rgcommand across local repos - ~1.3 MB output from an
rgcommand across/tmpand a local repo
Broader local impact:
~/.codex/sessionstotal size: ~91 GB- JSONL files over 100 MB: 184
- Largest observed session JSONL: ~1.95 GB
Session metadata:
originator: codex-tui- affected session
cli_version: 0.118.0 - current installed CLI:
codex-cli 0.134.0 - current binary path:
/opt/homebrew/bin/codex - affected session records
model_provider: openai, but no concrete model ID is present
Please try reproducing with the affected CLI version 0.118.0 by downloading/installing that version, running a long tool-heavy Codex TUI session, and then inspecting the
generated ~/.codex/sessions/.../rollout-*.jsonl file size and record breakdown.
Activity
etraut-openai commentedon Jun 1, 2026
We've decided to eliminate the TUI logs entirely. They were largely redundant because we now log to a sqlite db, and those logs are properly rotated and pruned, whereas the TUI logs were append-only. This change will be in the next release.
sriinnu commentedon Jun 9, 2026
i am not sure why this closed while its still an issue. The TUI also causing the issue. my codex sessions are in GB now.
etraut-openai commentedon Jun 9, 2026
Reopening because I misinterpreted the original bug report. I thought you were referring to logs (as indicated in the title), but upon closer read, you were talking about session rollout files. These rollout files are designed to record the full session details, so this isn't a bug. It's unusual for sessions to be so large that they consume hundreds of MB, but this is certainly possible if you use the same session repeatedly or use
/goalto drive the agent to work for long periods of time.We are looking to add compression to reduce the disk footprint. We're also going to add a delete command if you want to remove specific session rollouts completely.
banteg commentedon Jun 22, 2026
Adding a cross-link because this issue covers large rollout JSONL growth generally, and the more specific mechanism is tracked in #23257.
We inspected an affected local rollout that reached about
11.36 GiB. The detailed sanitized breakdown is here: #23257 (comment)Short version:
287compacted records contributed about10.68 GiBof the11.36 GiBrollout.payload.replacement_historycontaining response items.52.1 MiB.43uniqueinput_imagepayloads totaling about51.3 MiBwere copied as9,173image parts across compaction snapshots.input_image.image_urlcopies accounted for about10.66 GiBon disk, roughly~213xamplification of the unique image payload footprint.So this is not only "long session produces a large transcript". At least for this sample, append-only rollout persistence plus full
replacement_historysnapshots turns retained inline image payloads into runaway disk growth.etraut-openai commentedon Jun 22, 2026
The latest version of the CLI (0.141.0) includes a
codex delete <session ID>command that you can use if you want to delete specific sessions that have grown really large. I realize that's only part of the solution here, but I wanted to mention it in case it's of help to anyone who wants to free up some disk space.banteg commentedon Jun 22, 2026
note that you can also just ask codex to salvage these sessions. my 11.36gb session is now 700mb with all the images moved to the last compaction row.
sriinnu commentedon Jun 23, 2026
@banteg I've done that, but with long-running /goal sessions, the session data keeps accumulating and both the JSONL logs and SQLite db continue to grow over time. I just have a cron job which prunes every few days..
sriinnu commentedon Jul 8, 2026
Following up with data specific to the /goal angle @etraut-openai flagged back in June ("if you use... /goal to drive the agent to work for long periods of time").
Confirmed reproducible on my end: one /goal thread ran continuously for 14 days without ever rotating, growing to 613,100 lines / 202MB, with 126,748 exec_command calls. Cross-checking ~/.codex/goals_1.sqlite (thread_goals table), that single thread burned 559,871,882 tokens before hitting usage_limited. Checking all my goal threads: 6 of 12 have independently hit usage_limited, totaling 929M of ~1.05B cumulative tokens. This isn't an edge case - it looks like the default outcome for any /goal run left unattended for more than a few days.
One structural detail that might matter for a fix: thread_goals uses thread_id as its primary key, so a goal is permanently 1:1 bound to a single rollout/thread. There's no supported way to continue a goal in a fresh (compact) thread - only start an entirely new goal, losing continuity. If goal-driven work is meant to run long, it probably needs a goal_id-keyed continuation path that survives a thread rotation, not just better compression of the existing one.
In the meantime I built a stopgap using the new PostToolUse/PreCompact/PostCompact hooks -- PostToolUse truncates+archives large exec output before it's ever recorded so it can't be resent on later turns, PreCompact warns inside the session when a goal thread's already deep in goals_1.sqlite token debt...
atlaslabsworld commentedon Jul 13, 2026
Makes sense since I have 14GB of Codex session history since using GPT Pro 20x 5.6 Sol (X-high/Ultra) in Goal Mode; that means in the last 2 days I had 14 GB of memory eaten (yes, this was token-heavy work, I used 4 resets and ~1.5B tokens in one day alone).
and temporarily solved with a symlink to an external drive
runminglu commentedon Jul 16, 2026
Additional sanitized reproduction from macOS 26.4 (25E246), arm64.
Current installed binary is
codex-cli 0.144.5. Most of the affected rollout files were authored bycodex-tui 0.144.0-alpha.4, with smaller amounts from 0.144.0 through 0.145.0-alpha.16.Snapshot of
~/.codex/sessions:0.144.0-alpha.4alone account for about 11.7 GiBA representative subagent rollout is 101,184,191 bytes (96.5 MiB). Serialized-record breakdown:
Its session metadata identifies the source as
source.subagent.thread_spawn. This suggests an additional amplification path beyond a single long-running root thread: subagent rollouts inherit substantial parent context, then repeatedly persist that context incompacted.payload.replacement_history. In this sample, compacted records alone are roughly 80% of the file.No inline images dominate this particular sample. The dominant data is repeated compaction history. This remains observable in rollout files from the 0.144.x line, not only the 0.118.0 version in the original report.
fengjikui commentedon Jul 18, 2026
I investigated this on a real, privacy-sensitive workload and have a small, tested compression patch ready. I am posting the analysis first, per the invitation-only contribution policy, and would appreciate maintainer alignment/invitation before opening a PR.
Impact
On Codex 0.144.2,
~/.codex/sessionsreached 75,412,910,173 bytes (70.23 GiB) across 644 rollouts after roughly one to two months of heavy use:The audit is content-private: it reports sizes, JSON paths, counts, and hashes, and never prints message/tool contents.
What is being duplicated
I recursively analyzed a representative 760,247,640-byte (725 MiB) child rollout:
compactedrecords: 652.06 MiB / 89.936% of the file.data:URLs: 659.78 MiB.payload.replacement_history[].content[].image_url: 632.39 MiB.Exact-line deduplication would save only about 1.10 MiB because timestamps and surrounding metadata differ. This is content/history-level duplication, consistent with #23257.
There is also substantial parent/child duplication. Comparing strings of at least 256 bytes by SHA-256, the child contained 705.39 MiB of large strings and 704.50 MiB already existed in its parent: 99.874% overlap by bytes (98.434% by unique values).
Source trace
At current main (
56395bddaf26eb2829387ca6a417bf9128e5b239when tested):session::replace_compacted_historypersistsreplacement_history: Some(items.clone()); local/remote/v2 compaction paths all create full replacement histories.LiveThread::create_with_inherited_model_context;SessionMeta.history_baseexists, but the observed legacy rollouts still physically contain inherited context and the common creation/extraction paths leave it unset..jsonl.zstreading/materialization and a cold-compression worker already exist inrollout/src/compression.rs, butLocalThreadStoreCompressionis under-development/default-off, waits seven days, and uses zstd level 3 with its default match window.The current compression infrastructure is a good base, but default zstd cannot see repeated blocks separated by tens/hundreds of MiB. Also, a fixed seven-day delay does not help a workload that generated more than 50 GiB in two days.
Real-file compression benchmark
All rows use the same 760,247,640-byte rollout; full round trips were byte-identical by SHA-256.
I selected a 32 MiB maximum window (windowLog 25) rather than the best ratio. It gives most of the storage benefit while keeping encoder/decoder memory far below long=27 and is appropriate for two background jobs.
Focused patch ready
The local topic branch changes only
codex-rollout(55 inserted lines across two files):windowLog = ceil(log2(source_size)), clamped to 23..25;Validation:
just test -p codex-rollout: 100/100 passed;just fix -p codex-rollout: passed;just fmt: passed;git diff --check: clean.I also verified the installed 0.144.2 app-server can
thread/readboth a synthetic and a real compressed rollout without materializing it. A guarded local migration compressed 194 closed rollouts, verified every frame and decompressed SHA-256, skipped six files observed open, and explicitly saved 53.78 GiB. The session directory fell from 70.23 GiB to about 19.3 GiB while preserving logical JSONL bytes. These were cold candidates and no integrity failures were observed, butlsofdouble checks cannot theoretically close an open-after-check race. A general migration should stop Codex writers, and the automatic worker should resolve the representation/append coordination called out in #25089 before default enablement.Release compatibility follow-up
I downloaded official macOS arm64 release binaries, verified each asset against the SHA-256 digest in GitHub Release metadata, and ran the same isolated app-server probe through both
thread/readandthread/resume:.jsonl.zstSo 0.137.0 is the earliest tested downgrade-compatible stable release; merge/release timing alone would have incorrectly suggested 0.136.0. The local migration tool now requires an actual supplied Codex binary and refuses to modify storage unless its isolated read-and-resume probe passes.
Proposed sequencing
Would this focused compression change align with the maintainers' intended direction? If so, I would be happy to submit and own the PR; please explicitly invite it per
docs/contributing.md. I can also provide the privacy-preserving audit tool and more benchmark details if useful.5 remaining items
Akshmit commentedon Jul 21, 2026
Hit this too. My sessions were hitting 2GB and looping forever reporting fake success. I'm building a tiny open source watchdog that auto kills loops, rotates logs, and verifies real success. Want me to tag you when I push the fix tomorrow?
DAD-Studios commentedon Jul 22, 2026
Independent corroboration from a recovered/quarantined WSL profile. I am not attaching rollout contents because they contain private development conversations, but I parsed record types and byte counts without emitting payload values.
Environment/context:
sessions/size: 34,934,047,187 bytes (34.9 GB decimal)Largest rollout:
compacted: 212 records / 2,123,731,427 bytes (~89.8% of the file)response_item/function_call_output: 17,545 records / 155,589,120 bytesevent_msg: 27,910 records / 25,611,715 bytesA separate active rollout involved in the recovery incident was 573,845,348 bytes with 61,406 valid JSONL lines and no malformed tail. The quarantined Codex SQLite databases also passed full
PRAGMA integrity_check.This strongly matches the issue's repeated-compaction-history mechanism rather than ordinary transcript size or malformed writes. I found no recovered config override pointing to intentionally enabled trace/rollout verbosity.
Important separation from the incident that led to this forensic review: the WSL distro's host VHDX later suffered an independently evidenced NTFS compressed-file fragmentation/extent-limit failure. That host storage failure is being reported separately to Microsoft. It did not create the 2.36 GB valid JSONL structure described above; the bloat was already valid, structured Codex persistence. Conversely, I am not claiming Codex caused the VHDX failure.
Suggested acceptance criteria remain:
I can provide additional aggregate-only breakdowns if maintainers need them, but cannot post private rollout payloads publicly.
wasulajr commentedon Jul 23, 2026
I’m seeing the same unbounded rollout growth, with a particularly severe subagent fan-out amplification pattern in Codex Desktop.
Environment:
codex-cli 0.145.0-alpha.270.145.0-alpha.300.144.6Local structural findings (no private rollout data attached):
~/.codex/sessions: 135 GB totaltype:"compacted"recordsreplacement_historycontained 22 distinct user clipboard PNGs as inlinedata:image/png;base64,...input_imageitemsThe additional multiplier is subagent inheritance:
thread_spawnsubagent sessions created from the same image-heavy parentThis appears closely related to #24550 and #24388, but shows that an image-heavy parent plus subagent fan-out can turn a small number of pasted screenshots into more than 100 GB of rollout data. It also produced substantial disk/CPU activity consistent with #20864 because Desktop scans the hot sessions tree.
Expected behavior:
I can provide additional redacted structural statistics if useful, but the raw files contain private prompts, local paths, and screenshots.
grtninja commentedon Jul 23, 2026
Windows Codex Desktop corroboration, with an explicit limitation: during the #35032 compaction/reprocessing incident, the workstation was reported near capacity while the affected long-running thread accumulated repeated compaction history, raw tool output, screenshots, and evidence artifacts. Exact
.codex/sessionsbyte attribution has not yet been measured, so this is not presented as a quantified reproduction of the 700MB–2GB figures here. The visible behavior does match the same retention pattern: severalContext automatically compactedevents, immediate ~80% post-compaction occupancy, and repeated historical/tool state being carried forward. Please consider Codex Desktop/Windows session retention when fixing this report, not only CLI/TUI.Coldain commentedon Jul 25, 2026
Current-version Desktop data point, captured 2026-07-25 with privacy-safe record-type aggregation only.
Environment: macOS arm64, ChatGPT/Codex Desktop
26.721.41059, bundledcodex-cli 0.146.0-alpha.3.1,history_mode: legacy.One actively written 111,879,772-byte rollout on the current runtime was dominated by:
response_item/function_call_output: 80.6 MiB across 440 recordscompacted: 9.6 MiB across 7 recordsevent_msg/mcp_tool_call_end: 6.7 MiB across 96 recordsresponse_item/message: 2.3 MiB across 136 recordsSeparately, a historical 598 MB depth-1 child was dominated by inline image-generation results and custom tool outputs. The full session store is currently 122.2 GiB.
This indicates raw function/tool-output persistence remains a material growth path on
0.146.0-alpha.3.1, even when compaction is not the largest category in the active rollout. Per-record caps plus artifact references/deduplication would address both this path and the image-heavy cases.webhype commentedon Jul 26, 2026
While we're waiting for this to be resolved... has a kind soul perhaps written (with Codex hehe), a JSONL cleaner-upper? Something that blasts through all the JSONLs and surgically removes certifiable junk? I would do it but I don't know what separates junk from JSONL lines that are needed to keep my session integrity. There has to be a way to throw away 95% of this. If using all this space were a necessary thing, Claude would do the same, but it doesn't.
yourhousemktg-ctrl commentedon Jul 27, 2026
I can reproduce the same unbounded session-log growth in the Codex Desktop app on macOS, not only in CLI/TUI.
Environment
26.721.410590.146.0-alpha.3.1Observed impact
.jsonltranscript of2,787,011,429bytes (~2.6 GiB).~/.codex/sessionsstore reached ~3.2 GiB.~/.codex/sessions; I observed fiverg -l --no-ignore --glob '*.jsonl'searches at once.The key point is that the parent task was still actively working. The oversized file was a child-agent transcript, so the user cannot safely treat it as disposable or archive it just because the child pass emitted
task_complete.No raw session log is attached because it contains private project material. I can provide redacted record counts or diagnostics on request.
Please add app-side protections: bound/rotate session persistence, cap or deduplicate raw tool output and repeated compaction snapshots, avoid full raw-history scans in the desktop app, and provide safe user-visible storage controls.
webhype commentedon Jul 27, 2026
Here's a totally vibe-coded Bash script for Mac OS to solve the problem, without losing your chat history or tripping up Codex UI (mysteriously lost chats). I found that the .JSONL files contain copies of copies of copies of any and all PNGs (proof screenshots), some PNG-containing JSON lines are up to 10 MB big! They multiply like rabbits.
Rather than questioning why, I decided to replace them with a 8 x 8 pixel placeholder PNG of a small red ❌ right in the JSONL text. It seems to have no negative effect; I can still load all PNGs embedded inline in the chat history, but even if some got replaced with a placeholder, these proof screenshots that Codex generates have little future value and storing them as BASE64 is insane anyway.
Step 1: Before you trust anyone's script, even mine, review it before you run it!
Step 2: Throw this script somewhere where your Mac OS Terminal can find it (some place that's in
$PATH) and set execute permissions (chmod +x shrink-codex-jsonl-dir.sh)Step 3:
cdto one of your date folders that has grown excessively large, e.g.cd ~/.codex/sessions/2026/06/27Step 4: Execute the script, it will only process
.jsonlfiles >= 1 GiB and will list affected files and pause before processing each file:rar(brew install --cask rar) and deletes the old file after compression was verified. So you still keep your original file, should something go terribly wrong. The slimmer file replaces the old file. The old/big JSONL files compress really well so you might as well keep the .rar file, or if space is really tight, move it to some external disk.applesauce(brew install applesauce) which uses the Mac OS APFS or HFS+ compression to compress the newly-reduced file transparently on disk for an extra compression of about 50%. This is the little-known equivalent of NTFS file compression, just on Mac OS. The problem is, it can't compress files over 4 GiB and many of my Codex JSONLs exceed 5 GiB. After such files have been stripped of their BASE64-encoded PNGs, they are well under 4 GiB, soapplesaucecan do its work.That's it, once you poke around in your sessions folder you will see that very few "day folders" have the biggest files (often over 5 GiB) and some folders have (almost) nothing. So while a bit tedious, in the name of causing minimum damage, focus on one month (like June), and find the biggest day folders there and run this in them.
No warranty of any kind — if this deletes your home folder or sends your crypto keys to North Korea, not my responsibility!
ducksee commentedon Aug 3, 2026
Adding an independent data point that matches this diagnosis exactly (codex-cli 0.146.0, macOS arm64).
We dissected a 335 MB rollout accumulated by a single session in 7 days (20,584 lines), accounting bytes per record type:
compacted— fullreplacement_historysnapshotsfunction_call_outputcustom_tool_call_outputreasoningThe 62% is ~90 giant rows (>400 KB each, mostly ~4.6 MB): every auto-compaction appends another full copy of the replaced history. The growth loop we observed: output-heavy session → frequent auto-compaction → +4.6 MB snapshot per compaction → file bloat. So sessions with heavy tool output bloat fastest precisely because they compact most often.
Memory-side impact (the #29510 class): a different session whose rollout had been resume-chained since early May reached 16.2 GB on disk; resuming it ballooned the codex process to ~17 GB RSS and pushed a 16 GB machine deep into swap. Starting a fresh session (breaking the resume chain) dropped the process to ~90 MB.
One observation toward a cheap mitigation: since each
compactedrow'sreplacement_historysupersedes all earlier history, only the lastcompactedrow plus subsequent records appears to be needed for resume. An offline "vacuum" that drops superseded snapshots would have shrunk our 335 MB file by ~60% and the 16 GB one by roughly an order of magnitude — happy to test a patch or provide more data.neuralsyndicate commentedon Aug 4, 2026
Adding a severe independent reproduction from codex-cli 0.146.0 on Linux x86_64, using Codex Desktop with a remote Linux project.
A single long-lived parent-thread rollout reached exactly 59,589,245,094 bytes (59.6 GB decimal / ~55.5 GiB). The user-visible conversation itself was nowhere near that size.
Failure pattern
After the last normal user/assistant exchange, the thread entered a context-compaction loop and appended approximately 788 further compaction cycles. Representative cycles contained:
compactedJSONL record around 72.75 MB (observed sizes clustered around 72,747,402–72,756,021 bytes)world_state(~32 KB)turn_context(~4.5 KB)token_count/context_compactedeventscompactedrecord roughly 20–30 seconds laterThe tail reported:
This may be relevant to the trigger: compaction apparently failed to get the thread below the effective context limit, but the agent kept retrying and persisted another ~72.75 MB replacement history each time.
Impact
This also reproduces the unrecoverable-thread impact described in #25215, but with the storage amplification captured directly: repeated giant
compactedrecords turned one thread into a 59.6 GB file.Expected safeguards
compactedsnapshots should be replaceable/deduplicated or vacuumable.I cannot attach the raw JSONL because it contains private conversation history, tool inputs/outputs, and filesystem paths, but the byte counts and record-shape diagnostics above were collected without publishing payload contents.
ewzxyh commentedon Aug 8, 2026
Adding an independent Windows Codex Desktop data point.
Environment: Windows 11 x64, Codex Desktop (Microsoft Store build 26.803.5235.0).
Observed locally:
C:\Users\<redacted>\.codex) reached approximately 398.8 GB.sessionsaccounted for approximately 396.5 GB.rollout-*.jsonlfiles; the largest was 9.37 GB, with many others in the 2–5 GB range.session_meta,event_msg,turn_context,response_item, reasoning, function calls/outputs, and tool/web events.I did not publish any raw rollout content because it contains private prompts, tool I/O, and local project paths.
This appears consistent with the reports here: long-lived/resumed threads and repeated compaction or tool-output persistence can create multi-GB append-only rollouts. The continued multi-GB writes while the desktop app was open are especially concerning.
A per-session size/growth guard, compaction/vacuum of superseded history, and the documented desktop equivalent of
codex delete <session ID>would be very helpful for Windows users.georgfranz commentedon Aug 10, 2026
Adding an independent Linux data point that isolates a structural change in 0.147.0 which makes this worse: with the new paginated thread history, the full stdout of every command execution is now persisted, untruncated, as
item_completedevent records.Environment: codex-cli 0.147.0, three Linux hosts (Ubuntu server + WSL2), heavy multi-session use.
Observations from one representative rollout (
~/.codex/sessions/2026/08/08/rollout-…jsonl):event_msgrecords, of which 59.6 MB arepayload.type: item_completed(2,840 records).CommandExecutionturn items whosestdoutfield embeds the complete aggregated command output (fullpytestruns, fullrgoutput). Across our hosts we have seen singleitem_completedrecords up to ~2.7 MB.response_itemrecords add another 23.4 MB, so exec output is effectively persisted twice: once asfunction_call_output, once inside the completed item.Mechanism (from source at
rust-v0.147.0):should_persist_event_msgincodex-rs/rollout/src/policy.rspersists everyEventMsg::ItemCompletedwhen the thread's history mode isPaginated, and paginated thread history is what 0.147.0 rolled out (#36948/#36950, legacy migration in #37175). Rollouts written by 0.146.0 on the same hosts contain noitem_completedrecords at all; there,ExecCommandEndis classified as transient and never persisted.Impact beyond disk usage: anything downstream that consumes rollout JSONLs (we ingest them into an analytics/review pipeline) suddenly receives megabyte-sized
event_msgrecords where event messages used to be small envelopes. Across our three hosts theitem_completedpayload volume is on the order of 460 MB/day since the 0.146→0.147 upgrade, vs ~10 MB/day of event payloads before.Bounded persistence for
CommandExecution.stdoutin persisteditem_completedrecords (head/tail excerpt + byte count, like the model-facing truncation) would address both the disk growth reported here and the downstream breakage.dastan-maker commentedon Aug 17, 2026
Additional Windows Codex Desktop evidence:
logs_2.sqlitereached 265.8 MB and 112,695 rows in approximately ten days.Requested fixes:
Related reports: #21007, #22088, and #34268.
No raw task files or logs are attached because they contain private conversations and project information.
Detect Codex turn ends from its own task_complete event, not a heuristic
ariccio commentedon Sep 4, 2026
Disclosure: This comment was generated by Codex, operating fully autonomously in the research and drafting of this comment. GitHub attributes it to the authenticated
ariccioaccount, but Alexander Riccio is not the speaker or author of the technical claims below. His role in this publication is to provide the quoted prompts, choose the publication scope, and explicitly approve the exact text after preview.Verbatim user prompts and publication context
Prompt that initiated this issue census and comment drafting:
Additional public-safe context from the work that prompted this review:
Publication context: These excerpts came from a separate attempt to recover disk space safely while preserving valuable Codex history. Alexander asked Codex to map a fragmented public issue cluster against the pull request’s shipped scope because storage growth was obstructing active development and a safe resolution remained elusive. The quotations record Alexander’s motivation and impact; Codex independently researched and authored each target-specific technical comparison.
Publication control: this exact body was previewed and must be explicitly approved before publication. The technical wording must not be attributed to Alexander.
#42039, shipped in 0.153.0, adds a physical-storage mitigation for this issue: when the experimental default-off feature is enabled, eligible cold rollout JSONL files—including shared and forked histories—are zstd-compressed.
That does not prevent the logical write amplification documented here. Repeated
replacement_historysnapshots and raw tool output may still be written before the cold representation is compressed; #42039 changes how eligible old rollout files are represented, not which payloads are produced or repeated.