EasyGlobe EasyGlobe

Codex 0.142.0 SQLite Log Fix Upgrade Guide

By EasyGlobe Team 4 min read AI

In brief

Codex 0.142.0 reduces the SQLite log churn behind high disk writes. Learn how to upgrade, verify the fix, clean old logs, and remove temporary triggers.

Screenshot of Vaibhav Srivastav confirming the latest Codex release fixes the SQLite log issue
EasyGlobe Team

EasyGlobe Team

Global Growth Team

EasyGlobe helps teams expand into global markets with practical SEO, localization, LLM optimization, paid advertising, and growth operations. We turn complex international growth work into clear systems, high-quality content, and measurable execution.

Codex 0.142.0 is the version to install if you were affected by heavy SQLite log writes in ~/.codex/logs_2.sqlite. OpenAI published the release on June 22, 2026, and the release notes say it reduced persistent-log churn by removing per-event WebSocket payload logging and filtering duplicated telemetry records.

My practical recommendation is simple: upgrade first, then clean the old database. The fix changes future logging behavior, but it does not automatically shrink a database that already grew on your machine.

For related AI operations notes, browse the EasyGlobe Blog. This guide is focused only on the Codex SQLite log fix and the cleanup steps after upgrading.

Codex CLI terminal showing a SQLite log fix and upgrade checklist
Upgrade first, then verify that logs_2.sqlite no longer grows rapidly.

What changed in Codex 0.142.0?

The official Codex 0.142.0 release notes list a logging-related chore: reduced persistent-log churn. The same release also includes startup and session latency work, configurable rollout token budgets, indexed web search mode, and multi-agent delegation settings.

The direct logging fix is split across two merged pull requests. PR #29432 stops logging every successful Responses WebSocket event. PR #29457 filters noisy persistent log targets, including bridged dependency logs and duplicated OpenTelemetry mirror targets.

That means the fix is not a promise that Codex will never write local logs. It is a fix for the high-churn behavior that caused many unnecessary SQLite inserts, WAL writes, and prune cycles.

Who should upgrade?

  • Upgrade if your Codex version is lower than 0.142.0.
  • Upgrade if logs_2.sqlite or logs_2.sqlite-wal grew quickly during normal Codex CLI, desktop app, or editor-plugin use.
  • Upgrade before removing any temporary SQLite trigger workaround.
  • Upgrade even if your current database is small, because the fix is in the Codex client behavior.

How to check your current Codex version

Run this command in a terminal:

codex --version

If the output is older than 0.142.0, update. If you installed through several channels in the past, also check which binary your shell is using.

which codex

How to upgrade Codex CLI

The official Codex README documents multiple install paths. Use the one that matches how you installed Codex.

macOS or Linux install script

curl -fsSL https://chatgpt.com/codex/install.sh | sh

npm install

npm install -g @openai/codex@latest

Homebrew cask

brew upgrade --cask codex

After upgrading, verify again:

codex --version

How to verify that SQLite log writes are no longer abnormal

First check the files:

ls -lh ~/.codex/logs_2.sqlite ~/.codex/logs_2.sqlite-wal ~/.codex/logs_2.sqlite-shm 2>/dev/null

Then check the log level distribution:

sqlite3 ~/.codex/logs_2.sqlite "SELECT level, COUNT(*) FROM logs GROUP BY level ORDER BY COUNT(*) DESC;"

Finally compare row counts over a short window:

sqlite3 ~/.codex/logs_2.sqlite "SELECT COUNT(*) FROM logs"; sleep 15; sqlite3 ~/.codex/logs_2.sqlite "SELECT COUNT(*) FROM logs";

Some small movement can be normal. The suspicious pattern is thousands of rows being inserted in seconds while the retained row count stays nearly flat.

Workflow for upgrading Codex and checking SQLite log growth
The safest order is version check, upgrade, write-rate check, cleanup, then workaround removal.

How to clean old Codex SQLite log space

Upgrading fixes future behavior, but old database pages and WAL files can still occupy disk space. Close Codex first if possible, then run:

sqlite3 ~/.codex/logs_2.sqlite "PRAGMA wal_checkpoint(TRUNCATE); VACUUM; PRAGMA wal_checkpoint(TRUNCATE);"

If you do not need old local debug logs, you can delete the old rows and reclaim more space:

sqlite3 ~/.codex/logs_2.sqlite "DELETE FROM logs; PRAGMA wal_checkpoint(TRUNCATE); VACUUM; PRAGMA wal_checkpoint(TRUNCATE);"

This removes local debug log rows. It does not delete your Codex conversations or project files.

Should you remove the temporary trigger workaround?

If you previously created a trigger to block log inserts, keep it until you have upgraded and verified that row counts no longer jump rapidly. After that, you can remove it to restore normal local logging.

sqlite3 ~/.codex/logs_2.sqlite "DROP TRIGGER IF EXISTS block_log_inserts;"

Then rerun the 15-second row-count test. If the count stays stable or changes only slightly, the workaround is no longer needed.

FAQ

Does Codex 0.142.0 stop all SQLite writes?

No. It reduces the noisy persistent logging that caused abnormal churn. Normal local logging may still happen.

Will upgrading shrink logs_2.sqlite automatically?

No. Use VACUUM after upgrading if the old SQLite file is still large.

Is it safe to delete rows from logs_2.sqlite?

For normal users, yes: these are local debug logs, not the main conversation store. Keep a backup only if you need diagnostic evidence for a bug report.