You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
appIssues related to the Codex desktop appconfigIssues involving config.toml, config keys, config merging, or config updatesenhancementNew feature or request
The SQLite log database (logs_2.sqlite, used by the desktop app / codex app-server) is written at TRACE level by default, with no way to lower or disable it. RUST_LOG only affects stderr output — it does not influence what gets persisted to the SQLite log DB.
Environment
codex-cli 0.153.4 (latest release as of 2026-09-04; issue also reproduced on current main)
Windows 11, ARM64
Desktop app usage with local codex app-server
Observation
While monitoring C:\Users\User\.codex\logs_2.sqlite for 60 seconds:
~329 records written per minute (~5.5/s)
~74% are TRACE events, dominated by codex_app_server::outgoing_message (~241/min) plus websocket remote_control (~70/min)
DB holds ~21 MB (self-cleanup keeps row count bounded around ~30k, so size does not grow unbounded)
The volume is small in absolute terms, but for users who do not need full TRACE history, this is continuous unnecessary write activity with no way to opt out.
Root cause
The filter for the SQLite log layer is hardcoded in codex-rs/state/src/log_db.rs:
pubfndefault_filter() -> Targets{Targets::new().with_default(LevelFilter::TRACE)// hardcoded default for the log DB.with_target("h2",LevelFilter::WARN).with_target("hyper_util",LevelFilter::WARN).with_target("log",LevelFilter::OFF)// ...}
Adding Linux data from a TUI session (codex-cli 0.164.0, codex --yolo), in case it helps prioritise this.
Environment: Linux 7.2, btrfs (compress=zstd:1,noatime) on LUKS2/dm-crypt, consumer DRAM-less NVMe (~600 TBW rating).
What logs_2.sqlite contained (61 h window, 2026-11-01 23:57 → 2026-11-04 13:07, including idle time and suspend):
rows inserted (by id)
306,441 (≈1.4 inserts/s averaged over the whole window)
rows retained
25,139 (pruning keeps the table bounded, as in the original report)
lifetime id
50,818,581
avg estimated_bytes
1.2 KB
DB / WAL size
95 MB / 20 MB
Level split of retained rows: TRACE 37.9 %, DEBUG 30.5 %, INFO 31.1 %, WARN 0.5 %. Top targets:
target
level
rows
codex_app_server::outgoing_message
TRACE
3,882
codex_core::stream_events_utils
DEBUG
3,731
feedback_tags
INFO
2,834
codex_tui::markdown_stream
TRACE
2,470
codex_core::session::world_state
TRACE
1,480
So ~68 % of what is persisted is TRACE/DEBUG that, as far as I can tell, is only useful for feedback uploads.
Why it matters more on some filesystems: on copy-on-write filesystems every small committed transaction also rewrites metadata, so a steady trickle of tiny inserts costs far more device writes than its logical size (Mohan et al., arXiv:1707.08514, measured ~33× write amplification on btrfs for 4 KB random overwrites + fsync vs ~2–4× on xfs/ext4).
Workaround I used (unofficial, documented here only so others can measure the difference):
-- with Codex stopped; keep a backup of logs_2.sqliteCREATETRIGGERblock_log_inserts BEFORE INSERT ON logs BEGINSELECT RAISE(IGNORE); END;
After this, max(id) stayed constant while the session kept working, and Codex continued to run normally. Obviously this also drops WARN/ERROR rows, which is why a real setting is needed.
Suggestion, in line with the options above: make the log-DB filter configurable (e.g. log_db_level = "info", or "off"), and consider defaulting non-feedback sessions to INFO. If TRACE must be kept for feedback, buffering it in memory and only persisting when the user actually submits feedback would remove the steady write load entirely.
appIssues related to the Codex desktop appconfigIssues involving config.toml, config keys, config merging, or config updatesenhancementNew feature or request
Activity
piotrkowski commentedon Nov 4, 2026
Adding Linux data from a TUI session (
codex-cli 0.164.0,codex --yolo), in case it helps prioritise this.Environment: Linux 7.2, btrfs (
compress=zstd:1,noatime) on LUKS2/dm-crypt, consumer DRAM-less NVMe (~600 TBW rating).What
logs_2.sqlitecontained (61 h window, 2026-11-01 23:57 → 2026-11-04 13:07, including idle time and suspend):id)idestimated_bytesLevel split of retained rows: TRACE 37.9 %, DEBUG 30.5 %, INFO 31.1 %, WARN 0.5 %. Top targets:
codex_app_server::outgoing_messagecodex_core::stream_events_utilsfeedback_tagscodex_tui::markdown_streamcodex_core::session::world_stateSo ~68 % of what is persisted is TRACE/DEBUG that, as far as I can tell, is only useful for feedback uploads.
Why it matters more on some filesystems: on copy-on-write filesystems every small committed transaction also rewrites metadata, so a steady trickle of tiny inserts costs far more device writes than its logical size (Mohan et al., arXiv:1707.08514, measured ~33× write amplification on btrfs for 4 KB random overwrites + fsync vs ~2–4× on xfs/ext4).
Workaround I used (unofficial, documented here only so others can measure the difference):
After this,
max(id)stayed constant while the session kept working, and Codex continued to run normally. Obviously this also drops WARN/ERROR rows, which is why a real setting is needed.Suggestion, in line with the options above: make the log-DB filter configurable (e.g.
log_db_level = "info", or"off"), and consider defaulting non-feedback sessions to INFO. If TRACE must be kept for feedback, buffering it in memory and only persisting when the user actually submits feedback would remove the steady write load entirely.