codex - 💡(How to fix) Fix Codex Desktop becomes unusable on long active threads due to app-server/renderer memory and TRACE log churn [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#21134Fetched 2026-05-06 06:26:12
View on GitHub
Comments
1
Participants
2
Timeline
6
Reactions
0
Author
Timeline (top)
labeled ×4commented ×1cross-referenced ×1

Codex Desktop becomes nearly unusable with long-running active threads, even after compaction-aware local transcript pruning.

The slowdown appears to come from the Codex app-server and renderer repeatedly handling large hot conversation state and logging large websocket/SSE response frames into logs_2.sqlite.

Error Message

During the slowdown:

Root Cause

Codex Desktop becomes nearly unusable with long-running active threads, even after compaction-aware local transcript pruning.

The slowdown appears to come from the Codex app-server and renderer repeatedly handling large hot conversation state and logging large websocket/SSE response frames into logs_2.sqlite.

RAW_BUFFERClick to expand / collapse

Summary

Codex Desktop becomes nearly unusable with long-running active threads, even after compaction-aware local transcript pruning.

The slowdown appears to come from the Codex app-server and renderer repeatedly handling large hot conversation state and logging large websocket/SSE response frames into logs_2.sqlite.

Environment

  • Codex Desktop: 26.429.30905
  • Electron: 41.2.0
  • macOS: 26.0.1 (25A362)
  • Machine memory: 16 GB

Observed behavior

During the slowdown:

  • codex app-server spiked to ~64% CPU.
  • codex app-server sampled physical footprint peaked at ~4.4 GB.
  • A Codex renderer reached ~1.07 GB RSS.
  • logs_2.sqlite / WAL grew by about 1.4 MB in one second.
  • Recent log rows were dominated by TRACE entries from:
    • codex_api::endpoint::responses_websocket
    • codex_api::sse::responses
    • raw-ish response/frame logging such as response.completed / received websocket frames
  • One active long-running thread had grown back to ~839 MB with 22 compactions.
  • The app remained sluggish even after pruning older pre-compaction rollout records, until restart/reload.

Chronicle was not the active CPU source in this case.

Why this seems like a Codex Desktop issue

Compaction-aware pruning helps reduce hot rollout JSONL size, but the running Desktop app still appears to keep or reconstruct very large hot thread state in app-server/renderer memory.

Separately, TRACE logging of large websocket/SSE frames can make logs_2.sqlite churn quickly, which seems to amplify the slowdown.

This makes long-running "main" threads effectively degrade over time, even when compactions exist and old raw history has been pruned locally.

Expected behavior

Long-running threads should remain usable after compaction. Codex Desktop should not need manual JSONL pruning, log rotation, or full restart to recover basic responsiveness.

Suggested fixes

  • Truncate or disable large TRACE websocket/SSE payload logging in normal Desktop builds.
  • Avoid retaining/rendering full hot thread state after compaction.
  • Lazy-load old transcript/UI history instead of materializing the whole active thread.
  • Add a first-class local "prune/compact UI history" action that preserves agent-visible compacted context.
  • Release app-server/renderer in-memory thread state after compaction/pruning without requiring a full app restart.
  • Add diagnostics that show which active thread/log source is causing app-server or renderer pressure.

Impact

For users who keep long-running main threads open, Codex Desktop can become almost unusable: high CPU, high renderer/app-server memory, heavy SQLite log churn, and severe UI lag.

extent analysis

TL;DR

Disabling or truncating large TRACE websocket/SSE payload logging may help mitigate the slowdown in Codex Desktop.

Guidance

  • Investigate the codex_api::endpoint::responses_websocket and codex_api::sse::responses logs to understand the source of the large log entries.
  • Consider implementing lazy-loading of old transcript/UI history to reduce memory usage.
  • Evaluate the effectiveness of compaction-aware pruning and adjust the pruning strategy if necessary.
  • Monitor the logs_2.sqlite growth and consider implementing log rotation or truncation to prevent excessive growth.

Example

No specific code snippet is provided, but adjusting the logging configuration to truncate or disable large TRACE logs could be a potential solution.

Notes

The issue seems to be related to the handling of large hot conversation state and logging of websocket/SSE response frames. The suggested fixes provided in the issue may help alleviate the problem, but further investigation is needed to determine the root cause.

Recommendation

Apply workaround: Disabling or truncating large TRACE websocket/SSE payload logging may help mitigate the slowdown, as it is likely contributing to the excessive log growth and memory usage.

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…

FAQ

Expected behavior

Long-running threads should remain usable after compaction. Codex Desktop should not need manual JSONL pruning, log rotation, or full restart to recover basic responsiveness.

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 unusable on long active threads due to app-server/renderer memory and TRACE log churn [1 comments, 2 participants]