Codex App writes high-volume TRACE logs to logs_2.sqlite despite RUST_LOG=warn
What version of the Codex App are you using (From “About Codex” dialog)?
Codex App 26.623.31921; Codex CLI 0.142.2
What subscription do you have?
ChatGPT Pro / Codex App access
What platform is your computer?
Darwin 24.6.0 arm64 arm; macOS 15.7.7; Apple Silicon
What issue are you seeing?
I am seeing very high-frequency TRACE logging from Codex App into ~/.codex/logs_2.sqlite, even though the app-server process environment has RUST_LOG=warn.
Environment / versions:
- Codex CLI: 0.142.2
- Codex App: 26.623.31921
- macOS: 15.7.7, Apple Silicon
- app-server command: /Applications/Codex.app/Contents/Resources/codex app-server --analytics-default-enabled
- app-server env includes: RUST_LOG=warn, LOG_FORMAT=json
Observed behavior:
- ~/.codex/logs_2.sqlite continues to receive large amounts of TRACE rows.
- In one check, TRACE rows were about 90.65% of visible log rows.
- A 10 second sample at 2026-06-26 17:47:47 CST added about 1,798 log ids.
- A second 10 second sample at 2026-06-26 17:48:47 CST added about 1,032 log ids.
- At the time of testing, logs_2.sqlite was about 138 MB and logs_2.sqlite-wal was about 67-80 MB.
The highest-volume rows are mostly:
- TRACE|log
- TRACE|codex_api::sse::responses
- TRACE|codex_api::endpoint::responses_websocket
- TRACE|codex_mcp::connection_manager
Recent TRACE message samples include:
- Opcode: Data(Text)
- response.output_text.delta
- tokio_tungstenite WebSocketStream / poll_next / read
- WouldBlock
Impact:
After long Codex App sessions, the app can feel sluggish or reconnect, and Activity Monitor can show unexpectedly high disk writes for the Codex process. Browser networking appears normal on the same machine; Google and YouTube work normally. This looks more like local app-server logging / SQLite persistence than a general network outage.
I have not uploaded logs_2.sqlite because it may contain session text, local paths, or other private information.
What steps can reproduce the bug?
Feedback ID: 019ee38b-87b6-7942-b8f3-363ccc17a118
What is the expected behavior?
With RUST_LOG=warn, frame-level / token-delta TRACE logs should not be persisted continuously into the local SQLite log database, or they should be bounded/rotated so they do not create high write volume during normal use.
If this is expected behavior, please document the recommended way to lower or disable local SQLite TRACE logging for Codex App.
Additional information
No full local log database is attached because it may contain private session text, local paths, or other sensitive data. I can provide redacted samples if needed.
8 Comments
Potential duplicates detected. Please review them and close your issue if it is a duplicate.
Powered by Codex Action
I put up a candidate fix on my fork:
https://github.com/openai/codex/compare/main...Nicolas0315:codex/log-db-honors-rust-log?expand=1
What changed:
RUST_LOGinstead of using a hard-coded TRACETargetsfilter.RUST_LOGbehavior is preserved by falling back to TRACE.log,codex_otel.log_only, andcodex_otel.trace_safeare retained.RUST_LOG=warnsuppressing TRACE/INFO rows while retaining WARN, plus coverage that the no-env default still allows TRACE.Local verification on
rtx4090at commit6f9f177e43:just fmtgit diff --checkcargo test --manifest-path codex-rs\Cargo.toml -p codex-state sqlite_sink -- --nocapturecargo check --manifest-path codex-rs\Cargo.toml -p codex-state -p codex-app-server -p codex-tuiSSH validation on peer machines:
cyberagent-mac-m5max: fetched6f9f177e43;DIFF_CHECK_OK; focusedsqlite_sinktests passed;CARGO_CHECK_OK.nicolas2025: fetched6f9f177e43;DIFF_CHECK_OK; focusedsqlite_sinktests passed;CARGO_CHECK_OK; no lingeringcargo/rustc/linkprocesses.nicolas-macbook-pro: fetched6f9f177e43;DIFF_CHECK_OK; Cargo is unavailable on that host, so this was diff-only.rtx5060ti: fetched6f9f177e43;DIFF_CHECK_OK; Cargo is blocked by the host's known linker setup issue (link: extra operand ..., exit 101) before crate code compiles; no lingeringcargo/rustc/linkprocesses.After validation, upstream
mainhad advanced to526f495f3a;git merge-tree --write-tree origin/main HEADis clean, so I left the validated commit unchanged rather than rebasing and invalidating the SSH run.Adding a Windows + WSL-specific data point because this issue has a second-order impact that is easy to misread in Task Manager.
Environment:
OpenAI.Codex_26.623.4041.0_x64__2p2nqsd0c76g0codex-cli 0.142.2codex app-server --analytics-default-enabledRUST_LOG=warnandLOG_FORMAT=jsonObserved behavior:
logs_2.sqlitewhile idle or nearly idle.TRACE|log/ websocket / tokio-tungstenite style records, consistent with the reports above.sqlx-sqlite-worker, with stack evidence in the WSL Plan9 filesystem path.dllhost.exe, but thatdllhost.exeinstance mapped to the WSLPlan9FileSystemCOM server (vp9fs.dll, with WSL-related modules such aslxutil.dll,vmvirtio.dll,vmprox.dll).dllhost.exeshowed similar read volume. This makes the SQLite TRACE churn show up asdllhost.exe/ WSL filesystem activity rather than an obvious Codex process on the Windows side.Important local configuration detail:
sqlite_homefor the WSL app-server to a WSL-native ext4 path. That removes the Plan9/dllhost amplification, but it does not fix the root cause: persistent high-frequency TRACE logging into SQLite.Why this matters:
vmmemWSLCPU/cache activity, and non-descriptdllhost.exeI/O.RUST_LOG=warnis still misleading here if the persistent SQLite sink continues accepting high-volume TRACE-level records.Expected fix:
CODEX_LOG_DB_LEVEL/ config equivalent.Adding a macOS data point from the current latest release.
Environment:
26.623.81905(CFBundleVersion=4598)codex-cli 0.142.5RUST_LOG=warn,LOG_FORMAT=jsonObserved behavior:
~/.codex/logs_2.sqlite: about684M~/.codex/logs_2.sqlite-wal: about4.6-5.0M683.6 MiBtotal, with about306.0 MiBfree pagescodex doctor --jsonreportslog DB integrity: ok, so this does not appear to be caused by log DB corruption.Recent 60-second sample after restart:
Recent 300-second sample after restart:
Overall level distribution during testing:
Representative TRACE bodies were low-level transport/frame diagnostics such as
tokio-tungstenitepoll/read messages, parsed headers,Opcode: Data(Text), decompression messages, andReceived message {"type":"response..."}. I am not attaching the SQLite DB because it may contain private session text and local paths.This looks consistent with the candidate fix direction above: the persistent SQLite log sink should honor
RUST_LOG=warnor otherwise avoid high-volume TRACE persistence in production builds.Additional reproduction on macOS after the Codex move into ChatGPT.app.
Environment:
/Applications/ChatGPT.app26.707.31123, build5042codex-cli 0.144.0-alpha.4~/.codex/logs_2.sqliteBEFORE INSERT ON logs BEGIN SELECT RAISE(IGNORE); ENDtrigger namedcodex_block_logs_insertControlled test performed on 2026-07-10 Asia/Shanghai:
PRAGMA wal_checkpoint(TRUNCATE);codex_block_logs_insertPRAGMA wal_checkpoint(TRUNCATE);max(id),count(*), andlogs_2.sqlite-walsize/mtime for 20 seconds while Codex/ChatGPT was activeObserved during the 20 second unblocked window:
max(id)=180295896,count(*)=3915, WAL0Bmax(id)=180296162,count(*)=4181, WAL782832Bmax(id)=180296274,count(*)=4293, WAL1582112BNew rows inserted during the test window included TRACE/DEBUG records such as:
TRACE codex_api::sse::responses: 361 rows, ~378312 estimated bytesTRACE codex_app_server::outgoing_message: 161 rows, ~27831 estimated bytesTRACE hyper_util::client::legacy::pool: 49 rowsTRACE codex_mcp::connection_manager: 12 rowsDEBUG codex_core::stream_events_utils: 10 rowsCompared with earlier Codex.app builds, the very noisy
tokio-tungsteniteframe/header/payload traces were not present in this latest sample, so part of the original websocket frame logging appears improved. However, the persistent SQLite sink still accepts TRACE/DEBUG runtime records and continues growing WAL when the trigger workaround is removed.After restoring the trigger:
trigger_count=10Bmax(id)=180296630stable and WAL not growingExpected behavior:
I did not attach raw
logs_2.sqliteor full log rows because they may contain local paths and conversation/model-response content.Additional reproduction on the newer ChatGPT.app-bundled Codex build.
Environment:
26.715.21425, build5488codex-cli 0.145.0-alpha.18/Applications/ChatGPT.app/Contents/Resources/codex -c features.code_mode_host=true app-server --analytics-default-enabledRUST_LOG=warn[analytics] enabled = false[feedback] enabled = falsesqlite_homemoved to an external SSDObserved:
sqlite_home, the old~/.codex/logs_2.sqlitestopped growing, so the config migration worked.sqlite_homestill persisted high-volumeTRACErows.MAX(id)advanced by659TRACEcontinued to advancecodex_api::sse::responses,codex_app_server::outgoing_message, andcodex_mcp::connection_managerLocal workaround applied:
Validation after workaround:
TRACEno longer appeared in recent rows.TRACE max(id)stayed stable.+659/30sto+93/30s, roughly an 86% reduction.INFO/DEBUG/WARN/ERRORrows were still preserved.This is only a local workaround. The underlying issue appears to be that the persistent SQLite log sink still accepts
TRACEevents despiteRUST_LOG=warnand analytics/feedback collection being disabled.Additional reproduction after the latest ChatGPT.app / bundled Codex update.
Environment:
/Applications/ChatGPT.app26.715.31925, build5551codex-cli 0.144.6~/.codex/logs_2.sqliteBEFORE INSERT ON logs BEGIN SELECT RAISE(IGNORE); ENDtrigger namedcodex_block_logs_insertControlled test performed on 2026-07-20 Asia/Shanghai:
PRAGMA wal_checkpoint(TRUNCATE);codex_block_logs_insertPRAGMA wal_checkpoint(TRUNCATE);max(id),count(*), andlogs_2.sqlite-walsize/mtime for 20 seconds while Codex was activeObserved during the 20 second unblocked window:
count(*)=0, WAL0Bmax(id)=180296162,count(*)=229, WAL593312Bmax(id)=180296901,count(*)=271, WAL1005312Bmax(id)=180297221,count(*)=591Rows inserted during the test window included TRACE/DEBUG records such as:
TRACE codex_api::sse::responses: 365 rows, ~382504 estimated bytesTRACE codex_app_server::outgoing_message: 156 rows, ~26976 estimated bytesDEBUG codex_core::stream_events_utils: 10 rowsTRACE codex_core::session::turn: 3 rowsTRACE codex_mcp::connection_manager: 3 rowsCompared with older Codex.app builds, I did not see the previous very noisy
tokio-tungsteniteframe/header/payload records in this sample, so that part appears improved. However, the persistent SQLite sink still stores TRACE/DEBUG records during ordinary conversation activity, and WAL still grows when the trigger workaround is removed.After restoring the trigger:
trigger_count=10Bmax(id)=180297221stable and WAL not growingExpected behavior:
I am not attaching raw
logs_2.sqliteor full log rows because they may contain local paths and conversation/model-response content.Additional reproduction after another ChatGPT.app / bundled Codex update.
Environment:
/Applications/ChatGPT.app26.715.52143, build5591codex-cli 0.144.6~/.codex/logs_2.sqliteBEFORE INSERT ON logs BEGIN SELECT RAISE(IGNORE); ENDtrigger namedcodex_block_logs_insertControlled test performed on 2026-07-20 Asia/Shanghai:
PRAGMA wal_checkpoint(TRUNCATE);codex_block_logs_insertPRAGMA wal_checkpoint(TRUNCATE);max(id),count(*), andlogs_2.sqlite-walsize/mtime for 20 seconds while Codex was activeObserved during the 20 second unblocked window:
max(id)=180297221,count(*)=591, WAL0Bmax(id)=180297413,count(*)=783, WAL626272Bmax(id)=180297495,count(*)=865, WAL1322552Bmax(id)=180297815,count(*)=1185Rows inserted during the test window included TRACE/DEBUG records such as:
TRACE codex_api::sse::responses: 389 rows, ~416214 estimated bytesTRACE codex_app_server::outgoing_message: 146 rows, ~25271 estimated bytesDEBUG codex_core::stream_events_utils: 10 rowsTRACE codex_core::session::turn: 3 rowsTRACE codex_mcp::connection_manager: 3 rowsTRACE codex_core::session::world_state: 1 rowI still do not see the older high-volume
tokio-tungsteniteframe/header/payload records in this sample, so that part appears to remain improved. However, the persistent SQLite sink still stores TRACE/DEBUG records during ordinary conversation activity, and WAL still grows when the trigger workaround is removed.After restoring the trigger:
trigger_count=10Bmax(id)=180297815stable and WAL not growingExpected behavior:
I am not attaching raw
logs_2.sqliteor full log rows because they may contain local paths and conversation/model-response content.