OpenAI Codex Desktop 審計報告指出 516-token 截斷、即時擷取 1 MiB Git 差異及 SQLite 資料未清零
Auditing OpenAI Codex Desktop: 516-Token Cutoffs, Live 1 MiB Git Diffs, and Unzeroed SQLite
Denis Vaulin 與 Oleksii Mai 審計 OpenAI Codex Desktop,報告稱推理輸出在 516 tokens 出現截斷,遙測可擷取最多 1 MiB 原始 Git diff。
Co-authored equally by Denis Vaulin (GitHub · LinkedIn) and Oleksii Mai (GitHub · LinkedIn).
- Interactive Forensic Report: nehumorist.github.io/codex-local-audit
- Offline Read-Only MIT Auditor (Node.js & Python): github.com/NeHumorist/codex-local-audit
In October 2026, OpenAI Codex Desktop running in high / ultra reasoning mode started dropping reasoning output and hiding reasoning summaries while burning through subscription quota faster.
Rather than guess from UI symptoms, we ran a cross-platform forensic audit across:
-
1,502 local
~/.codex/session rollouts across Windows 11 x64 (215sessions /34,523calls) and macOS arm64 (1,287sessions /160,172calls), plus an independent third-party Pro reproduction across246.8kcalls; -
Signed client binaries (
OpenAI.Codex_26.1111.2228.0on Windows x64 andv26.1111.71704on macOS arm64 — bothcodexandapp.asar) cross-checked against the publicopenai/codexRust repository; -
Local SQLite stores (
queue_1.sqlite,logs_2.sqlite,thread_history_1.sqlite,codex-dev.db,memories_1.sqlite) anddictation-history/; - Two official EU GDPR "Export Data" archives from OpenAI.
Everything below is reproducible offline on your own machine in 5 seconds using our read-only MIT tool.
1. The Quantized 516-Token Cutoff Wall (518k - 2 Harmonics)
Across both our Plus/Pro datasets and an independent third-party Pro user's 246.8k-call dataset, reasoning output exhibits a sharp discontinuity at exactly 516 tokens:
| Dataset | Calls at 515
|
Calls at 516
|
Calls at 517
|
1034 (2 blocks) |
1552 (3 blocks) |
2070 (4 blocks) |
|---|---|---|---|---|---|---|
3rd-Party Pro (246.8k calls) |
70 |
9,021 |
0 |
1,280 |
384 |
139 |
macOS (160.2k calls) |
— | 9,392 |
1 |
1,608 |
497 |
169 |
Three checks confirm this is not a tokenizer quirk or a simple rate-limit artifact:
-
Harmonic spacing at
518k - 2: spikes repeat cleanly at516,1034,1552, and2070reasoning tokens. -
Ciphertext byte-length correlation (
r = 0.99538):reasoning_output_tokenstracks the rawencrypted_contentciphertext byte lengths directly (rTok == 0calls carry0encrypted reasoning bytes). -
Not a quota ceiling:
71.2%(and78.7%on macOS) of exact-516cutoffs occurred below80%on both the 5-hour and 7-day subscription windows.
Alongside this cutoff, turn_context.summary silently flipped from "detailed" to "none" without a client update.
2. Live 1 MiB Raw git diff Capture Firing While Opted Out
Inspecting signed app.asar (907538.0572f09d40.js, verified byte-for-byte across Windows and macOS builds) shows a telemetry payload (codex_turn_diff_event) that captures up to 1 MiB (1,048,576 bytes) of raw unified git diff source code (diff, between_turn_diff, session_start_diff, visualization_diff, repository_full_name, commit/tree SHAs) and sends it to /wham/analytics-events/events.
The gate checks only is_zdr === false and Statsig gate 586515394 — performing zero checks of training_allowed: false or [analytics] enabled = false.
In live Windows Desktop runtime logs (%LOCALAPPDATA%\Codex\Logs, 2026-11-05), we captured post-gate execution (method=turn-diff-capture-complete workerId=git -> Failed to complete turn diff analytics capture) tied to the exact EU account whose official OpenAI GDPR export records:
{
"training_allowed": false,
"video_training_allowed": false,
"voice_training_allowed": false
}
3. Windows Explorer UserAssist Scraping & Default-On Analytics
Inside signed app.asar, embedded PowerShell (Get-UserAssistEntries, Decode-Rot13) reads Windows Explorer's HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\UserAssist\*\Count registry keys and writes a catalog of installed third-party applications (last_used, use_count) to ~/.codex/cache/computer-use/computer-use-app-catalog/.../user-assist.json.
On our Windows test host, user-assist.json cached 82 non-OpenAI applications (alongside 28 [external-agent-import] scans of competitor directories like ~/.claude and .cursor).
At the same time, while OpenAI's Rust CLI source (cli/src/main.rs) comments that analytics default to off for app-server, Electron unconditionally passes --analytics-default-enabled, and Codex Settings provides 0 UI toggles to disable telemetry.
4. Local SQLite Erasure Gaps, Microphone Retention & Incomplete GDPR Exports
-
0calls toPRAGMA secure_deleteacross all10,502files ofopenai/codexand signed binaries:queue_1.sqlitemeasured98.6%unzeroed freelist pages at0live rows (+ recoverable prompts in-wal), andlogs_2.sqlitemeasured90.6%–91.8%unzeroed deleted pages. -
thread_history_1.sqlitecontains0ON DELETE CASCADEforeign keys and is skipped byStateRuntime::delete_thread. -
dictation-history/retains unencrypted local Opus microphone audio + transcripts with zero TTL (54+days on Windows; up to78days including cancelled captures on macOS). -
Plaintext
auth.jsonon Windows:codex_desktop_secret_auth_storageexplicitly excludes Windows. -
0of1,502Codex sessions appeared across two official EU GDPR "Export Data" archives (150.8 MBand186.8 MB), even thoughexport_manifest.jsonreported"omissions": [].
5. Negative Controls: What We Checked and Ruled Out
To keep every claim anchored strictly to verifiable bytes, our report explicitly documents 10 hypotheses we checked and ruled out, including:
-
CodexWindowsSystemSerialObserved(gate1259783540): unhashed Windows BIOS serial collection and local debug-log redaction are compiled into signedapp.asar, but the gate had not activated on our test host. -
0localmodel_rerouteevents inside~/.codex/sessions/JSONL records. - Standard
5h/7dquota exhaustion (ruled out because >71% of516cutoffs occurred below 80% quota).
Verify Your Own Machine in 5 Seconds (MIT, Read-Only, Offline)
codex-local-audit has full feature parity across zero-dependency Node.js (22.15+ / 24+) and Python 3.10+. It opens every SQLite database strictly read-only, makes zero network calls, never opens or reads auth.json, and strips all prompts, code, app names, and file paths.
git clone https://github.com/NeHumorist/codex-local-audit.git
cd codex-local-audit
# Node.js 22.15+ / 24+ (zero external dependencies)
node audit_codex.mjs
# Or Python 3.10–3.13 via uv
uv run --with zstandard python audit_codex.py
On Windows without a global Node 24 install, you can invoke the Node 24 runtime already bundled with Codex Desktop:
$node24 = Get-ChildItem "$env:LOCALAPPDATA\OpenAI\Codex\runtimes\cua_node\*\bin\node.exe" | Select-Object -First 1 -ExpandProperty FullName
& $node24 .\audit_codex.mjs
- Interactive Forensic Report: https://nehumorist.github.io/codex-local-audit/
- Source Code (MIT): https://github.com/NeHumorist/codex-local-audit
If you run the audit on Codex Plus or Pro, feel free to share anonymized counts in the comments — we are especially interested in whether the 516 / 1034 / 1552 pattern reproduces on newer builds.
來源:DEV Community · dev.to