OpenAI Codex 日誌記錄錯誤:過度的 SSD 寫入與解決方案

OpenAI Codex 日誌記錄錯誤:過度的 SSD 寫入與解決方案

OpenAI Codex 日誌記錄錯誤導致過度的 SSD 磨損

A critical bug in OpenAI Codex causes the application to write massive amounts of data—potentially terabytes—to local SSDs. This issue stems from the application shipping with trace/debug logging enabled by default, utilizing an unbounded SQLite database that lacks log rotation or capacity caps.

技術根本原因:無限制的 SQLite Trace Logs

Performance degradation and disk consumption are caused by a "firehose" of trace-level logs being written to a SQLite database. Because the logging system does not implement rotation or size limits, the log files grow indefinitely, consuming available disk space and increasing wear on SSD hardware.

立即性解決方案與修復方法

Until an official update is deployed, users can employ the following technical workarounds to prevent further disk writes:

SQLite Trigger Block

A temporary fix involves creating a SQLite trigger to block further inserts into the logs table. The following command can be executed against the Codex log database:

sqlite3 ~/.codex/logs_2.sqlite "CREATE TRIGGER IF NOT EXISTS block_log_inserts BEFORE INSERT ON logs BEGIN SELECT RAISE(IGNORE); END;"

Filesystem Redirection

To prevent physical SSD wear, some users suggest symlinking the log directory to a tmpfs (RAM-backed filesystem), ensuring that logs are written to volatile memory rather than permanent storage.

社群回饋與效能疑慮

Beyond the logging bug, the community has highlighted several other stability and performance issues with Codex:

  • GPU Resource Exhaustion: Reports indicate that simply having the Codex window unhidden on macOS can cause 100% GPU usage due to the rendering of the "spinner" loading message.
  • Input Latency: Users have reported significant typing latency compared to competitors like Claude Code.
  • Cross-Tool Issues: Similar logging issues have been reported in other AI coding tools, with one user noting that Claude Code also writes massive debug logs to ~/.claude/logs.

目前狀態

According to community reports, a fix has been committed to the Codex repository (commit e98d43ac372ddf7f513c0...) and is expected to be included in the next official release. Users are encouraged to monitor the official GitHub repository for the update.

Sources