openai / openai/codex

[Windows app] File logger retains consumed records under sustained write backpressure

Open
#43,475 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

app bug performance windows-os
Dominant language
Rust
Stars
125k
Forks
19.4k
PR merge metrics
PR metrics pending

Description

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

Microsoft Store package: OpenAI.Codex 26.901.6511.0 (Windows x64)
Application version: 26.901.51231

What subscription do you have?

Pro 20×

What platform is your computer?

Windows 11, build 26200, x64. The reproduction below uses synthetic data and does not require a signed-in account or a model request.

What issue are you seeing?

The desktop file logger can retain already-consumed log records during sustained write backpressure.

In this build, the queue inside .vite/build/file-based-logger-DhdrY1cq.js, function N, advances its head after a write. When the stream returns false, the early return can occur before consumed entries are released. Repeating that write/drain pattern leaves the array holding old records even after its pending count reaches zero. The pending-line limit does not bound those consumed entries.

An isolated test executes the actual function extracted from the installed archive with a controlled writable stream:

After 3,001 consumed records Original Local reference fix
Pending records 0 0
Retained array entries 3,001 0

This establishes a retention path in the logger. It does not establish logging as the cause of every long-session slowdown or the separate DWM/compositor reports.

What steps can reproduce the bug?
  1. Use the exact supported Store build above.
  2. Obtain the English reference implementation.
  3. Run node tests/run.cjs --installed with Node.js 24.
  4. Inspect the original-versus-patched backpressure case in tests/render-desktop-logger.cjs.

The test fixture is generated locally from the official archive. A fake stream returns false from write(), then emits drain repeatedly. The same original and corrected logger functions receive the same events; no real prompts, account files, or conversation IDs are included.

What is the expected behavior?

Release consumed entries before taking the backpressure return, and keep memory bounded when writes remain paused.

The local reference change:

  • Clears the queue immediately when its head reaches its length, and periodically compacts a partially consumed queue.
  • Tracks pending bytes in addition to the native line count, with an 8 MiB pending-byte budget.
  • Bounds oversized individual records while retaining their beginning and end and adding an explicit truncation notice.
  • Releases queued data on asynchronous stream failure and handles synchronous failure without negative byte accounting.
  • Preserves normal ordering, drop notices, rotation, initialization fallback, and subsequent recovery after a thrown write.
Additional information

The logger suite has 11 passing behavioral cases. The complete repair package has 188 passing cases, including 62 portable tests and 126 cases using generated native fixtures. Both Windows and Ubuntu CI run the portable suite. Original input hashes, patch offsets, and output hashes are recorded in the manifest.

I am submitting reproducible findings and a reference implementation through the issue tracker in accordance with the current contribution policy, for maintainers to implement in the maintained desktop source. No official binaries, full client bundles, credentials, or user data are distributed. The analysis and harness were developed with Codex assistance; the reported tests were actually executed.

Original project: wjtianze/codex-desktop-repair. If these findings or fixes help you, a star on the original repository is appreciated.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with .vite/build/file-based-logger-DhdrY1cq.js and function N, then run node tests/run.cjs --installed with Node.js 24. Inspect tests/render-desktop-logger.cjs and its original-versus-patched backpressure case. Done means consumed entries are released, memory remains bounded during paused writes, and the logger behavior tests pass without breaking ordering or recovery.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, node.js
Domain
desktop, observability-sre
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.