Quando logs TRACE viram escrita constante no SSD
Hoje eu fui investigar uma suspeita simples: o arquivo ~/.codex/logs_2.sqlite parecia estar sendo escrito sem parar.
A hipótese era que algum log em nível TRACE estava despejando eventos demais no SQLite. Não era uma suspeita absurda. O arquivo já estava grande, havia um -wal ativo, e o horário de modificação mudava o tempo todo.
Então fui medir.
Primeiro olhei os arquivos:
logs_2.sqlite 417 MB
logs_2.sqlite-wal 10 MB
Depois fiz uma amostragem curta do mtime e do tamanho do WAL. O resultado foi claro: o WAL era atualizado várias vezes por segundo.
Abrindo o SQLite em modo somente leitura, a tabela era simples:
logs (
id INTEGER PRIMARY KEY AUTOINCREMENT,
ts INTEGER NOT NULL,
level TEXT NOT NULL,
target TEXT NOT NULL,
feedback_log_body TEXT,
module_path TEXT,
process_uuid TEXT,
estimated_bytes INTEGER NOT NULL DEFAULT 0
)
A distribuição recente confirmou o problema. Em uma janela curta, quase tudo era TRACE.
Alguns exemplos dos alvos mais barulhentos:
codex_api::endpoint::responses_websocket
codex_api::sse::responses
tokio-tungstenite
hyper_util
E os corpos dos logs mostravam atividade de WebSocket em baixo nível:
WebSocketStream
Stream.poll_next
https://t.co/L8IHxRRaR5
WouldBlock
received frame
Opcode: Control(Pong)
Ou seja: não era um log ocasional de aplicação. Era ruído de transporte em nível TRACE.
O processo principal era o codex.exe app-server do Codex Desktop.
A intervenção
Antes de mexer em qualquer coisa, fiz backup:
backup lógico consistente via API do SQLite
cópia bruta de logs_2.sqlite
cópia de logs_2.sqlite-wal
cópia de logs_2.sqlite-shm
Depois instalei um trigger para interceptar novas escritas na tabela logs:
CREATE TRIGGER codex_block_logs_insert
BEFORE INSERT ON logs
BEGIN
SELECT RAISE(IGNORE);
END;
Esse trigger não apaga logs antigos. Ele só ignora novos inserts na tabela.
Em seguida rodei:
PRAGMA wal_checkpoint(TRUNCATE);
O WAL caiu para 0 bytes.
O resultado
Amostrei por 30 segundos depois da mudança.
Resultado:
MAX(id): estável
count(*): estável
logs_2.sqlite-wal: 0 bytes
mtime do WAL: sem mudança
Antes, em 20 segundos, apareceram 300 novas linhas TRACE.
Depois do trigger, nada novo entrou na tabela.
Isso estava destruindo o SSD?
Provavelmente não.
SSD moderno aguenta muito mais escrita do que algumas dezenas de KB/s em janelas curtas. Não era um cenário de “meu disco vai morrer amanhã”.
Mas era escrita desnecessária, contínua e silenciosa. E isso importa.
Não só por desgaste. Também por:
crescimento de arquivo sem valor prático
atividade constante de disco
WAL sempre ativo
ruído em backup/indexação/antivírus
dificuldade de separar logs úteis de ruído
Então a resposta equilibrada é: não parecia uma emergência de hardware, mas fazia sentido cessar a escrita.
A ressalva
Isso não “conserta” a origem do log TRACE.
O processo ainda pode tentar emitir esses eventos. O trigger só impede que eles sejam persistidos na tabela logs.
Também não bloqueia outras escritas normais do Codex, como estado, sessão, cache ou outros bancos SQLite. Ele atua apenas sobre a tabela logs de logs_2.sqlite.
Para desfazer:
import sqlite3, os
p = os.path.expanduser(r"~/.codex/logs_2.sqlite")
conn = sqlite3.connect(p)
conn.execute("DROP TRIGGER IF EXISTS codex_block_logs_insert")
conn.commit()
print(conn.execute("PRAGMA wal_checkpoint(TRUNCATE)").fetchall())
conn.close()
O problema era real: havia escrita contínua em logs_2.sqlite, dominada por logs TRACE de WebSocket/transporte.
A mitigação com trigger funcionou: novas linhas deixaram de entrar, o WAL foi truncado e parou de crescer durante a amostragem.
Não é a solução ideal de produto. A solução ideal seria o próprio aplicativo respeitar um nível de log menos verboso ou não persistir esse tipo de TRACE por padrão.
Mas como mitigação local, reversível e com backup, resolveu o sintoma mais incômodo: escrita constante e inútil no SSD.
The CODEX desktop version is currently using the latest Store package, but the built-in CLI is still version 0.142.0-alpha.6.
I also observed for 15 seconds: 318 new log IDs were added, but the number of retained rows only increased by 5.
This indicates that the "continuous insertion and pruning" pattern still exists, but there wasn't a sudden surge in disk expansion at that moment.
1/
Codex is quietly killing your SSD.
It writes diagnostic logs to disk non-stop, even when you're not
doing anything. Your SSD has a write limit. Codex is burning through it in the background.
One command fixes it 👇
‼️ A Chrome extension called Volume Booster, with roughly 2 million weekly users, activated a commerce-tracking SDK across its entire base without ever prompting for consent.
The trick: a broad all-sites permission was granted in an earlier version and left unused, then a later update switched on the Give Freely affiliate SDK without requesting any new permission, so Chrome shipped it silently.
The SDK registers a persistent device ID, geolocates users by IP, and sends telemetry continuously, while the store's privacy declaration still claims no data collection beyond core functionality.
A broad permission granted early and activated later via a prompt-free update is a detectable supply-chain signal.
Google is testing a new reCAPTCHA that asks you to wave your hand at your camera.
The reason: AI can now solve every traditional CAPTCHA. traffic lights, crosswalks, fire hydrants, distorted text. all defeated. bots pass them faster than humans.
So Google's solution is biometrics. your hand. on camera. 21 joint coordinates extracted. analyzed. verified.
Google says: videos deleted after verification. not linked to your identity. audio never recorded.
now here's the timeline of what Google has said about data before:
CAPTCHA was originally designed to help digitize old books and street signs. harmless. useful. then Google used it to label training data for Street View and Google Maps. you were solving puzzles. you were also labeling Google's datasets for free.
And the new system: already bypassed. A user demonstrated it using a virtual camera feeding AI-generated hand animations. the verification designed to prove you're human was defeated by an AI pretending to have a hand.
so to recap:
the old CAPTCHA farmed your attention for training data.
the new CAPTCHA wants your camera and your hand geometry.
it's already broken.
and the bot traffic it's trying to stop just crossed 55% of all internet traffic.
Google needs you to wave at your camera to prove you're human.
The AI watching you wave already knows you are.
It just needed the footage.
🚨 TRUMP SPARKS DIPLOMATIC CRISIS WITH ITALY: Italy’s Foreign Minister Antonio Tajani has canceled his planned June 21–22 trip to Washington after President Trump insulted Prime Minister Giorgia Meloni, claiming she “begged” for a photo with him at the G7 and that he “felt sorry for her.”
Meloni released a video firing back at Trump’s comments, calling them “completely fabricated.”
“I am frankly appalled,” she said. “I don’t know why the President of the United States behaves this way towards his allies.”
She added that Trump appears to show more accommodation toward “the enemies of the West” than America’s allies and concluded by saying: “Italy and I never beg.”