Skip to content

Windows Codex app continuously writes high-volume TRACE websocket logs to ~/.codex/logs_2.sqlite despite RUST_LOG=warn #29463

Description

@LeoZhu1999

Summary

On Windows, Codex Desktop continuously writes high-frequency TRACE logs into ~/.codex/logs_2.sqlite, mainly from websocket/tungstenite internals, even though RUST_LOG=warn and analytics/OTel export are disabled in ~/.codex/config.toml.

This causes persistent SQLite/WAL writes and database growth.

Environment

  • OS: Windows
  • Codex app package: OpenAI.Codex_26.616.6631.0_x64__2p2nqsd0c76g0
  • Codex app-server process:
    • codex.exe app-server --analytics-default-enabled
  • Database:
    • C:\Users\<user>\.codex\logs_2.sqlite
    • WAL mode with logs_2.sqlite-wal

Relevant config

~/.codex/config.toml includes:

[analytics]
enabled = false

[otel]
exporter = "none"

Environment variable checks:

RUST_LOG Process = warn
RUST_LOG User    = unset
RUST_LOG Machine = unset

Observed behavior

After fully restarting Codex Desktop, logs_2.sqlite continues to receive high-frequency writes.

A 28-second sample after restart showed:

max(id) increased by 573
logs_2.sqlite-wal continued updating
row count stayed constant, indicating new rows are inserted while older rows are deleted

Recent 1000 inserted ids were dominated by:

TRACE log                                      839 rows
INFO  codex_otel.log_only                      41 rows
INFO  codex_otel.trace_safe                    40 rows
TRACE codex_api::endpoint::responses_websocket 40 rows
TRACE codex_api::sse::responses                40 rows

Latest TRACE log bodies include low-level websocket/tungstenite messages such as:

tokio-tungstenite ... compat.rs ... Read.with_context read -> poll_read
tokio-tungstenite ... lib.rs ... WebSocketStream.with_context
Parsed headers [...]
WouldBlock

Impact

  • Continuous disk writes to SQLite/WAL
  • logs_2.sqlite growth and churn
  • Extra local storage usage
  • Potential performance and SSD wear concern
  • TRACE-level logs may capture more detailed internal request/response metadata than expected

Before manual maintenance, the database was approximately:

logs_2.sqlite before VACUUM: 199,499,776 bytes
logs_2.sqlite after VACUUM:   75,206,656 bytes

After reopening Codex, WAL growth resumed:

logs_2.sqlite-wal around 5 MB and still updating

Expected behavior

With RUST_LOG=warn, [analytics].enabled = false, and [otel].exporter = "none", Codex should not continuously persist high-volume TRACE websocket/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

  1. Start Codex Desktop on Windows.
  2. Ensure:
    • RUST_LOG=warn
    • [analytics].enabled = false
    • [otel].exporter = "none"
  3. Open or continue a Codex thread.
  4. Inspect ~/.codex/logs_2.sqlite and ~/.codex/logs_2.sqlite-wal.
  5. Sample max(id), level, target, and WAL modification time over 20-30 seconds.
  6. Observe continuous inserts of TRACE log, codex_api::endpoint::responses_websocket, and codex_api::sse::responses.

Notes

I avoided attaching the SQLite database directly because it may contain sensitive local diagnostic/session details.

Metadata

Metadata

Assignees

No one assigned

    Labels

    appIssues related to the Codex desktop appapp-serverIssues involving app server protocol or interfacesbugSomething isn't workingconfigIssues involving config.toml, config keys, config merging, or config updatesperformancewindows-osIssues related to Codex on Windows systems

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions