codex - 💡(How to fix) Fix Codex Desktop becomes unrecoverable on launch when the most recent session rollout exceeds ~500 MB [1 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#20269Fetched 2026-04-30 06:30:51
View on GitHub
Comments
1
Participants
2
Timeline
5
Reactions
0
Timeline (top)
labeled ×4commented ×1

Root Cause

Root cause appears to be an unbounded function_call_output size in the rollout JSONL: tool stdout (rg matches, Read of multi-MB JSON files, build/test stdout) is written verbatim, so a single line can be tens of MB. The auto-resume code path then attempts to deserialize the full file into the renderer's state on launch, which is unrecoverable past a few hundred MB.

RAW_BUFFERClick to expand / collapse

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

26.422.8496.0_x64

What subscription do you have?

GPT PRO

What platform is your computer?

Windows 11 Pro 26200

What issue are you seeing?

A long-running agent task (~20 hours, ~3,300 turns) on a moderately heavy repository produced a single rollout JSONL file of 718.6 MB / 3,305 lines (avg ~222 KB per line). After the agent loop deadlocked mid-tool-call and the unresponsive process was force-quit, every subsequent launch of Codex Desktop entered a non-recoverable freeze: the renderer process holds Responding=False while CPU pegs at ~140% of one core and working-set memory grows by ~1 GB every 10 seconds — apparently while attempting to auto-resume the oversized session.

Root cause appears to be an unbounded function_call_output size in the rollout JSONL: tool stdout (rg matches, Read of multi-MB JSON files, build/test stdout) is written verbatim, so a single line can be tens of MB. The auto-resume code path then attempts to deserialize the full file into the renderer's state on launch, which is unrecoverable past a few hundred MB.

What steps can reproduce the bug?

  1. Open Codex Desktop in a workspace where:
    • Read of common data files produces multi-MB tool outputs
    • Aggressive rg queries match across many files
  2. Start a long agent task and let it run unattended for many hours / hundreds of turns. (In our case the task spawned subagents that themselves performed expensive searches, compounding output volume.)
  3. The agent loop eventually deadlocks mid-tool-call — no new events are written to the rollout JSONL, but the renderer process remains alive with Responding=False.
  4. Force-quit Codex Desktop.
  5. Relaunch Codex Desktop.

What is the expected behavior?

The app should launch and remain responsive even if the most recent session is unusually large. Acceptable approaches:

  • Lazy / incremental loading of session history (render the latest N turns, stream older ones in).
  • A startup size-threshold check that prompts the user ("Most recent session is 718 MB and may freeze the app. Resume anyway, or start a fresh session?") instead of silently auto-resuming.
  • Silent fallback to a new session when the rollout exceeds a safe threshold.

Additional information

  • The app window appears, then becomes unresponsive within a few seconds.

  • The session is auto-resumed and the freeze persists across every subsequent launch — the user is locked out of the app entirely.

  • A 10-second snapshot of the renderer process during the freeze:

    metricT₀T+10sdelta
    CPU (cumulative)503.7 s518.1 s+14.4 s / 10 s ≈ 140% of one core
    Working set1,089 MB2,266 MB+1,177 MB / 10 s
    RespondingFalseFalse
    rollout jsonl LastWriteTime26 min ago26 min ago(no new events)

    The agent loop is silent (no new turns being written), but the renderer is clearly burning resources in a tight loop — most likely while parsing or rendering the oversized session history.

  1. The rollout JSONL was held with an exclusive write lock by the frozen process for the full duration of the freeze, even though the agent loop had stopped emitting new events 26 minutes earlier. (Verified via System.IO.File.Open failing with sharing violation, then succeeding immediately after the process was killed.) This suggests the agent-loop hang and the renderer hang are independent stuck paths inside the same process — which is consistent with the symptom that the process keeps consuming resources even though no new turns are being produced.
  2. logs_2.sqlite-wal continued to receive small writes during the freeze, suggesting a background diagnostic logger remained active while the agent loop was deadlocked. The 2.4 GB size of logs_2.sqlite itself suggests there is no rollover policy on this DB.

extent analysis

TL;DR

Implement a size-threshold check for the rollout JSONL file to prevent the renderer process from attempting to deserialize excessively large files.

Guidance

  • Identify the maximum allowable size for the rollout JSONL file to prevent the renderer from freezing, and implement a check at startup to prompt the user or start a fresh session if the file exceeds this threshold.
  • Consider implementing lazy or incremental loading of session history to reduce memory usage and improve responsiveness.
  • Review the agent loop and renderer process to ensure they are properly releasing resources and locks when idle or deadlocked, to prevent resource starvation and freezes.
  • Investigate the background diagnostic logger to determine why it remains active during the freeze and consider implementing a rollover policy for the logs_2.sqlite database to prevent excessive growth.

Example

No code example is provided as the issue does not specify the programming language or framework used.

Notes

The exact implementation details will depend on the specific architecture and technology stack of the Codex App, which is not fully specified in the issue. Additionally, the root cause of the agent loop deadlock and renderer freeze may be complex and require further investigation to fully resolve.

Recommendation

Apply a workaround by implementing a size-threshold check for the rollout JSONL file to prevent the renderer process from freezing, as this is a clear and actionable step that can be taken to mitigate the issue.

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

codex - 💡(How to fix) Fix Codex Desktop becomes unrecoverable on launch when the most recent session rollout exceeds ~500 MB [1 comments, 2 participants]