Codex app logs_2.sqlite high-frequency WAL writes from TRACE/streaming events
Summary
Codex app on Windows appears to continuously write high-volume local runtime logs into ~/.codex/logs_2.sqlite / WAL, suspected TRACE or streaming event logging. This caused visible local disk churn and WAL growth during normal Codex desktop usage.
Environment
- OS: Windows, native Codex desktop app
- Codex app package observed locally:
OpenAI.Codex_26.623.13972.0_x64__2p2nqsd0c76g0 - Codex executable path observed:
C:\Program Files\WindowsApps\OpenAI.Codex_26.623.13972.0_x64__2p2nqsd0c76g0\app\resources\codex.exe - Runtime database:
C:\Users\A\.codex\logs_2.sqlite - Date observed: 2026-07-05 Asia/Shanghai
Evidence collected
Initial readonly file-size check:
logs_2.sqlite: 61,251,584 bytes, 58.41 MiBlogs_2.sqlite-wal: 3,221,872 bytes, 3.07 MiBlogs_2.sqlite-shm: 32,768 bytes, 0.03 MiB
15 second file-level sampling before mitigation:
logs_2.sqlite: 61,251,584 bytes -> 61,251,584 byteslogs_2.sqlite-wal: 4,132,392 bytes -> 4,132,392 bytes- WAL LastWriteTime advanced during the sample window
After temporary mitigation, file-size check:
logs_2.sqlite: 61,251,584 bytes, 58.41 MiB, LastWrite 2026/7/5 12:11:36logs_2.sqlite-wal: 4,239,512 bytes, 4.04 MiB, LastWrite 2026/7/5 12:12:29logs_2.sqlite-shm: 32,768 bytes, 0.03 MiB, LastWrite 2026/7/5 12:04:27
sqlite3 and lsof were not available in PATH, so detailed level distribution and open-handle inspection were not completed.
Temporary local mitigation applied
A user-confirmed SQLite trigger was added to stop further inserts into logs:
CREATE TRIGGER IF NOT EXISTS block_log_inserts
BEFORE INSERT ON logs
BEGIN
SELECT RAISE(IGNORE);
END;
Readback confirmed:
trigger=('block_log_inserts', 'logs')
This is only a local emergency workaround. It silently drops future local log rows and should not be considered a proper fix.
Expected behavior
Codex should not continuously write high-volume TRACE/streaming-event logs to local SQLite during normal desktop use, or it should expose a documented way to bound, rotate, sample, disable, or lower the verbosity of this runtime log stream.
Actual behavior
The local SQLite runtime log database and WAL showed ongoing write activity and WAL growth. User perceived it as high-frequency disk writes.
Request
Please investigate whether Codex desktop is over-logging TRACE/streaming events into logs_2.sqlite, especially on Windows, and provide an official fix or mitigation that does not require modifying the SQLite schema manually.
4 Comments
Potential duplicates detected. Please review them and close your issue if it is a duplicate.
Powered by Codex Action
Additional macOS reproduction evidence for
logs_2.sqlitehigh-frequency writes.Environment:
codex-cli 0.133.0BROWSER_USE_CODEX_APP_VERSION = "26.623.141536"/Users/lixuru/.codex/logs_2.sqliteLocal read-only checks used:
file:$HOME/.codex/logs_2.sqlite?mode=rolsofonly for open-handle inspectionVACUUM, no checkpoint/truncate, no schema changes, no process killEvidence before config experiment:
logs_2.sqlite,logs_2.sqlite-wal, andlogs_2.sqlite-shm.462139392bytes.4420792bytes.logstable state:COUNT(*) = 57198MIN(id) = 208527087MAX(id) = 2535959122026-07-07 02:57:22TRACE log:981rows,125277estimated bytesTRACE codex_app_server::outgoing_message:19rows,3220estimated bytesTRACE codex_api::sse::responses:16rows,16404estimated bytesDEBUG codex_core::stream_events_utils:12rows,23348estimated bytesTRACE codex_mcp::connection_manager:12rows,9032estimated bytesEarlier same-machine 60 second quiet sampling after update:
MAX(id) = 253494040at2026-07-07 01:05:40MAX(id) = 253497196at2026-07-07 01:06:40MAX(id)advanced by3156whileCOUNT(*)stayed constant at57198.Config workaround experiments:
``
toml
`[feedback]
enabled = false
MAX(id)After a normal Codex restart, a 60 second quiet sample still advanced
from253632139to253634131` and WAL mtime continued advancing.``
toml
`[feedback]
enabled = false
max_bytes = 67108864
MAX(id)After a normal Codex restart, a 60 second quiet sample still advanced
from253698415to253700711` and WAL mtime continued advancing.max_bytesstill showed the same dominant sources:TRACE log:946rowsTRACE codex_api::sse::responses:37rowsTRACE codex_app_server::outgoing_message:36rowsDEBUG codex_core::stream_events_utils:7rowsImpact:
[feedback]settings.Requested upstream fix:
log_levelor equivalent for the SQLite runtime log stream.logs_2.sqlite, if they exist.Adding a fresh Windows data point from a newer build.
Environment:
26.707.91948codex-cli 0.144.5%USERPROFILE%\.codex\logs_2.sqliteRead-only snapshots:
517,644,288bytes; WAL37,220,112bytes.1,046,462,464bytes; WAL5,051,152bytes.Rows added after the earlier snapshot cutoff:
| Level | Rows | estimated_bytes |
|---|---:|---:|
| TRACE | 560,765 | 305,029,237 |
| DEBUG | 155,850 | 106,041,789 |
| INFO | 94,391 | 56,355,741 |
| WARN | 4,699 | 2,878,563 |
| ERROR | 522 | 620,921 |
That is 816,227 new rows and about 470.9 MB of estimated payload. TRACE + DEBUG alone account for 716,615 rows and about 411 MB. No insert-blocking trigger or other SQLite mitigation was enabled.
The app remains usable, but the persistent high-volume logging clearly continues on the current Windows build.
Adding another Windows reproduction with read-only SQLite/WAL measurements and a reversible emergency mitigation.
Environment
codex-cli 0.144.4~/.codex/logs_2.sqlite)RUST_LOG,CODEX_LOG,OTEL_LOG_LEVEL, orOTEL_TRACES_EXPORTERvalue was present in the process environment.config.toml.Before mitigation
PRAGMA quick_check:oklogsOver a fixed 10-second interval after the initial snapshot:
MAX(id): +151A bounded aggregate over the retained rows in the latest 100,000-ID range found:
process_uuidvaluesThe leading TRACE targets included:
codex_api::sse::responsescodex_app_server::outgoing_messagehyper_util::client::legacy::*codex_mcp::connection_managercodex_tui::markdown_streamcodex_core::session::turncodex_http_client::transportNo log message bodies, prompts, headers, tokens, or other private payloads were read or included in this report.
Emergency local mitigation
After making an online SQLite backup and verifying that backup with
PRAGMA quick_check, a persistent table-wide trigger was added:This is an unsupported emergency workaround. It suppresses all new local diagnostic log rows, not only TRACE, and may reduce the usefulness of future
/feedbackdiagnostic attachments. No existing rows were deleted, and no WAL/SHM file was removed, truncated, checkpointed, or vacuumed.After mitigation
Across 16 samples over 15 seconds:
MAX(id)remained unchanged.idremained unchanged.PRAGMA quick_check:okA separate reusable read-only check repeated the same validation over 10 seconds and passed.
This reinforces that high-frequency local writes are coming from the SQLite diagnostic sink during ordinary Codex activity, and that watching only WAL size or row count can miss ongoing overwrite/prune churn. A supported upstream control for SQLite log level, sampling, retention, or disabling this sink would be much safer than schema triggers.