Repository navigation
Windows Codex app continuously writes high-volume TRACE websocket logs to ~/.codex/logs_2.sqlite despite RUST_LOG=warn #29463
Description
Activity
- addedbugSomething isn't workingSomething isn't workingappIssues related to the Codex desktop appIssues related to the Codex desktop appwindows-osIssues related to Codex on Windows systemsIssues related to Codex on Windows systemsapp-serverIssues involving app server protocol or interfacesIssues involving app server protocol or interfacesconfigIssues involving config.toml, config keys, config merging, or config updatesIssues involving config.toml, config keys, config merging, or config updates
on Jun 22, 2026 github-actions commented
on Jun 22, 2026 on Jun 22, 2026 – with GitHub ActionsContributorMore actionsPotential duplicates detected. Please review them and close your issue if it is a duplicate.
- Codex SQLite feedback logs can write ~640 TB/year and rapidly consume SSD endurance #28224
- Codex Desktop on Windows generates excessive local SQLite I/O and causes system stalls #29177
- logs_2.sqlite-wal grows without bound into tens of GB #28997
Powered by Codex Action
Duplicate of:
Which should have been fixed by:
- Stop logging every Responses WebSocket event #29432
- Filter noisy targets from persistent logs #29457
Which were released in:
But there still seem to be issues after that:
Reacted by DreamownYancyWei commented
on Jun 23, 2026 More actionsAdditional Windows reproduction / mitigation data from another Codex Desktop install.
Environment:
- OS: Windows
- Log DB:
C:\Users\Admin\.codex\logs_2.sqlite - Timezone: Asia/Shanghai
- Observed on: 2026-06-23
Observed state before mitigation:
logs_2.sqlitesize:753,307,648bytes (~718 MiB)logs_2.sqlite-walexisted and was updatinglogstable retained row count:67,214MAX(id): advanced from58,159,254to58,204,400during investigation- Level counts in retained rows:
TRACE:33,672, estimated bytes69,385,610INFO:27,662, estimated bytes37,341,429DEBUG:5,626, estimated bytes7,687,324WARN:226ERROR:28
Recent high-frequency sample:
- Around
2026-06-23 12:10, one minute contained ~2,000log rows, including ~1,499TRACErows. - Recent rows were dominated by websocket/tungstenite internals and frame parsing, including
WouldBlock,Read.with_context,AllowStd.with_context,WebSocketStream.with_context, received websocket frames, parsed headers, opcodes, etc.
Top retained targets by count included:
TRACE codex_api::endpoint::responses_websocket:12,771rows, estimated bytes49,797,435TRACE log:10,515rowsTRACE codex_mcp::connection_manager:2,711rowsTRACE hyper_util::client::legacy::pool:2,652rowsTRACE codex_api::sse::responses:2,418rowsINFO codex_otel.log_only:13,225rowsINFO codex_otel.trace_safe:13,207rows
SQLite metadata:
journal_mode:walpage_size:4096page_count:183,913freelist_count:138,975
The large freelist means the DB file stayed large after pruning/retention cleanup, so the retained row count substantially under-represents the write volume that already occurred.
Temporary mitigation applied locally:
- Backed up
logs_2.sqlite,logs_2.sqlite-wal, andlogs_2.sqlite-shm. - Added a local trigger to block further inserts into
logs:
CREATE TRIGGER IF NOT EXISTS codex_block_logs_insert BEFORE INSERT ON logs BEGIN SELECT RAISE(IGNORE); END;
- Ran
PRAGMA wal_checkpoint(TRUNCATE). - Sampled for ~21 seconds afterward.
Post-mitigation sampling result:
MAX(id)stayed fixed at58,204,400- retained row count stayed fixed at
67,214 logs_2.sqlitestayed fixed at753,307,648byteslogs_2.sqlite-walstayed fixed at0bytes
This confirms the write churn was coming through
logsinserts, and blocking that table stopped WAL growth on this machine. This workaround is obviously not ideal because it disables persisted logs, but it was needed to stop the local write churn.Confirmed independently on Windows with Codex Desktop 26.616.9593.0 (x64).
Before cleanup:
logs_2.sqlite: 197,857,280 byteslogs_2.sqlite-wal: 6,027,592 bytes- Retained rows: 7,310
- Levels: TRACE 4,639 (63.5%), INFO 2,190, DEBUG 465, WARN 16
MAX(id): 22,467,668- SQLite freelist: 43,622 / 48,305 pages (~90.3%)
During a 5-second sample, the retained row count stayed constant while
MAX(id)increased by 44, confirming continuous insert/delete churn.RUST_LOGwas alreadywarn, with no trace/debug/sqlite override inconfig.toml. After deleting TRACE/DEBUG, runningVACUUM, truncating the WAL, and persistingRUST_LOG=warn, TRACE/DEBUG immediately returned. During a subsequent 10-second sample,MAX(id)increased by 151.As a diagnostic workaround, a SQLite
BEFORE INSERTtrigger that ignored TRACE/DEBUG stopped those records completely; only one INFO record was added during the next 10-second sample. This suggests the high-volume records are being persisted upstream of, or independently from, the documentedRUST_LOGfilter.No database or raw log bodies are attached because they may contain sensitive session data.
Reacted by DaveW001I can reproduce this on Windows with a newer Codex Desktop package.
Environment
- OS: Windows
- Codex package:
OpenAI.Codex_26.616.9593.0_x64__2p2nqsd0c76g0 - Codex executable:
C:\Program Files\WindowsApps\OpenAI.Codex_26.616.9593.0_x64__2p2nqsd0c76g0\app\resources\codex.exe - Database:
C:\Users\<redacted>\.codex\logs_2.sqlite
C:\Users\<redacted>\.codex\logs_2.sqlite-wal
Observed behavior
The database is in WAL mode. The main database file size stays mostly unchanged, but
logs_2.sqlite-walcontinues to update while Codex is running.A read-only snapshot showed:
-
MAX(id)increased by 188 within 10 seconds. -
Later,
MAX(id)increased by another 155 within 25 seconds. -
The total row count did not meaningfully increase, which suggests Codex may be inserting new log rows while pruning old rows.
-
In a recent 30-second window:
- Around 09:30:02, there were about 2010
TRACErows, with an estimated log-body size of about 1.33 MB. - Around 09:31:05, the recent 30-second window still contained about 1258
TRACErows.
- Around 09:30:02, there were about 2010
-
Recent one-hour write sources were dominated by:
TRACE log: 1041 rowsTRACE codex_api::sse::responses: 1003 rows
-
The latest log rows were almost all
TRACE. -
The associated
process_uuidpointed to the currently running Codex process.
Configuration
I did not find any explicit
TRACE,RUST_LOG, or log-level configuration in:C:\Users\<redacted>\.codex\config.tomlWindows denied reading the full process command line, so I cannot confirm whether the log level is being set by the startup environment.
Expected behavior
Codex Desktop should not continuously persist high-frequency
TRACElogs into the local SQLite log database during normal usage, especially when no TRACE-level logging is configured by the user.If persistent local diagnostic logging is intentional, there should be a documented option to reduce the SQLite log level or disable high-volume TRACE persistence.
Yassycodes commented
on Jun 25, 2026 More actionsThanks for writing this up. I am seeing a related Windows Codex Desktop performance regression in #28855. My case started with a large
logs_2.sqlite/ WAL problem too, but even after rotating logs and reproducing with small fresh logs, Codex Desktop still caused intermittent mouse/typing/system input lag on Windows.I linked your report in a broader Discussion collecting recent Windows Desktop performance reports here: #29949 (comment)
No action needed from you unless you want to add more detail there, but I wanted to connect the reports because the recent Windows performance issues look related enough that they may need a canonical tracker.
Reacted by DaveW001Expected: the SQLite sink builds its own
Targetsfilter (hardcoded TRACE) and only the stderr layer honorsRUST_LOG. Fix addsCODEX_LOG_DB_LEVEL(and[log] level) and lowers the default to INFO: https://github.com/denispol/codex/pull/1StellaTC commented
on Jul 21, 2026 More actionsI can reproduce this on Windows with Codex Desktop
OpenAI.Codex_26.715.8383.0.A read-only 60.293-second sample after a full app restart showed:
- 436 newly inserted rows by
MAX(id) - 378 TRACE rows (86.7%, about 6.27 TRACE rows/sec)
- about 2.52 MiB estimated TRACE payload
- WAL net growth of 379,040 bytes
- writes continued throughout the window, so this is not startup-only logging
The dominant targets in a later 120-second sample were:
codex_api::sse::responses: 662 rowscodex_app_server::outgoing_message: 309 rowscodex_http_client::transport: 4 rows totaling about 2.38 MB
The transport and SSE records can contain complete request JSON, conversation/tool arguments, and SSE event bodies. I did not attach the database because it contains sensitive local context.
Source inspection agrees with the root-cause analysis in #31542: the SQLite sink has its own TRACE-default filter, while
RUST_LOG=warnonly limits terminal/stderr output. Restarting withRUST_LOG=warntherefore does not mitigate the SQLite writes.Could the maintainers please clarify:
- Is there an internal fix plan for this?
- Is there any currently undocumented environment variable or config option that can set the SQLite sink to
warnoroff? - What is the intended design purpose and retention policy of this local SQLite collector?
- Could Codex provide a persistent option such as
CODEX_SQLITE_LOG_LEVEL=warn|off, and avoid persisting full request/SSE payloads by default?
Until there is a supported switch, users handling sensitive work cannot reliably prevent this content from being retained locally.
Reacted by DaveW001- 436 newly inserted rows by
Confirming this is still very much alive on Windows. I went into the database to find out what's actually burning the space, and it's almost entirely one source.
logs_2.sqlite grew from ~15 MB to 619 MB in a single day — normal usage, nothing unusual. Inspected the table (~31k rows) and the breakdown was lopsided enough that a single module accounts for nearly all of it:
target rows approx bytes codex_http_client::transport 1,567 ~610 MB everything else combined ~29,800 ~8 MB So roughly 99% of the growth is full HTTP request/response payloads logged at TRACE. Individual entries run 3 to 5 MB each. The remaining ~30k rows across all the normal debug and info targets add up to less than 8 MB combined.
RUST_LOG=warn does nothing for this sink, confirming what others have reported. No config.toml setting I've found touches it.
I ended up having to script a daily task that kills Codex, renames the SQLite files, and lets the app rebuild them empty. Works, but it's the kind of thing that shouldn't be necessary. Either respect the configured log level or at least give us a knob to disable transport-level payload logging. Right now there's no user-facing way to stop it.
Lots of Windows users hitting this. Would really like to see it get traction.
Tell Codex to use SQLite Trigger to silently drops TRACE logs insertions, it works on my side
Confirmed on Windows with Codex Desktop package
26.803.10989.0and bundled CLI0.147.0-alpha.6.6.RUST_LOG=infowas present in the spawned task environment, butlogs_2.sqlitestill received TRACE/DEBUG rows. In one 10-minute sample, the database recorded:- TRACE: 966 rows
- DEBUG: 237 rows
The WAL was actively updated. The peak observed second had 43 log rows, including 41 TRACE rows.
This confirms the SQLite logger appears to bypass the standard Rust log filter in a newer Windows Desktop build as well. Please provide a supported setting to suppress or bound local SQLite TRACE/DEBUG persistence.
No raw log database or session content is attached, because those may contain private data.
Summary
On Windows, Codex Desktop continuously writes high-frequency
TRACElogs into~/.codex/logs_2.sqlite, mainly from websocket/tungstenite internals, even thoughRUST_LOG=warnand analytics/OTel export are disabled in~/.codex/config.toml.This causes persistent SQLite/WAL writes and database growth.
Environment
OpenAI.Codex_26.616.6631.0_x64__2p2nqsd0c76g0codex.exe app-server --analytics-default-enabledC:\Users\<user>\.codex\logs_2.sqlitelogs_2.sqlite-walRelevant config
~/.codex/config.tomlincludes:Environment variable checks:
Observed behavior
After fully restarting Codex Desktop,
logs_2.sqlitecontinues to receive high-frequency writes.A 28-second sample after restart showed:
Recent 1000 inserted ids were dominated by:
Latest
TRACE logbodies include low-level websocket/tungstenite messages such as:Impact
logs_2.sqlitegrowth and churnBefore manual maintenance, the database was approximately:
After reopening Codex, WAL growth resumed:
Expected behavior
With
RUST_LOG=warn,[analytics].enabled = false, and[otel].exporter = "none", Codex should not continuously persist high-volumeTRACEwebsocket/tungstenite logs to the local SQLite log store during normal use.If local SQLite diagnostics intentionally retain TRACE records, there should be a documented configuration option to disable or reduce this verbosity.
Reproduction steps
RUST_LOG=warn[analytics].enabled = false[otel].exporter = "none"~/.codex/logs_2.sqliteand~/.codex/logs_2.sqlite-wal.max(id),level,target, and WAL modification time over 20-30 seconds.TRACE log,codex_api::endpoint::responses_websocket, andcodex_api::sse::responses.Notes
I avoided attaching the SQLite database directly because it may contain sensitive local diagnostic/session details.