{"slug": "auditing-openai-codex-desktop-516-token-cutoffs-live-1-mib-git-diffs-and-sqlite", "title": "Auditing OpenAI Codex Desktop: 516-Token Cutoffs, Live 1 MiB Git Diffs, and Unzeroed SQLite", "summary": "Two developers, Denis Vaulin and Oleksii Mai, published a forensic audit of OpenAI Codex Desktop finding a sharp reasoning-output discontinuity at exactly 516 tokens across roughly 246.8k third-party Pro calls and 160.2k macOS calls, with reasoning summaries silently flipping from \"detailed\" to \"none\". Inspecting the signed app.asar, they found a telemetry payload capturing up to 1 MiB of raw git diff source code that gates only on an is_zdr flag and a Statsig gate, ignoring training_allowed and analytics opt-out settings, plus embedded PowerShell that scrapes Windows UserAssist registry keys to catalog installed third-party apps. They released a read-only MIT tool to reproduce the findings offline.", "body_md": "Co-authored equally by **Denis Vaulin** ([GitHub](https://github.com/NeHumorist) · [LinkedIn](https://www.linkedin.com/in/nothumorist)) and **Oleksii Mai** ([GitHub](https://github.com/alekseimai) · [LinkedIn](https://www.linkedin.com/in/alekseimai)).\n\nIn 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.\n\nRather than guess from UI symptoms, we ran a cross-platform forensic audit across:\n\n`~/.codex/` session rollouts`215` sessions / `34,523` calls) and macOS arm64 (`1,287` sessions / `160,172` calls), plus an independent third-party Pro reproduction across `246.8k` calls`OpenAI.Codex_26.1111.2228.0` on Windows x64 and `v26.1111.71704` on macOS arm64 — both `codex` and `app.asar`) cross-checked against the public `openai/codex` Rust repository;`queue_1.sqlite`, `logs_2.sqlite`, `thread_history_1.sqlite`, `codex-dev.db`, `memories_1.sqlite`) and `dictation-history/`;\nEverything below is reproducible offline on your own machine in 5 seconds using our read-only MIT tool.\n\n`516`-Token Cutoff Wall (` 518k - 2` Harmonics)\nAcross 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**:\n\n| Dataset | Calls at `515` | Calls at `516` | Calls at `517` | `1034` (2 blocks) | `1552` (3 blocks) | `2070` (4 blocks) | \n|---|---|---|---|---|---|---|\n| **3rd-Party Pro (`246.8k` calls)** | `70` | **`9,021`** | **` 0`** | `1,280` | `384` | `139` | \n| **macOS (`160.2k` calls)** | — | **`9,392`** | **` 1`** | `1,608` | `497` | `169` | \n\nThree checks confirm this is not a tokenizer quirk or a simple rate-limit artifact:\n\n`1034`, `1552`, and `2070` reasoning tokens.`r = 0.99538`):` reasoning_output_tokens` tracks the raw `encrypted_content` ciphertext byte lengths directly (`rTok == 0` calls carry `0` encrypted reasoning bytes).`71.2%`` 78.7%` on macOS) of exact-`80%`\nAlongside this cutoff, `turn_context.summary` silently flipped from `\"detailed\"` to `\"none\"` without a client update.\n\n`1 MiB` Raw `git diff` Capture Firing While Opted Out\nInspecting 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`.\n\nThe gate checks only `is_zdr === false` and Statsig gate `586515394` — performing **zero checks** of `training_allowed: false` or `[analytics] enabled = false`.\n\nIn 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:\n\n```\n{\n  \"training_allowed\": false,\n  \"video_training_allowed\": false,\n  \"voice_training_allowed\": false\n}\n```\n\n`UserAssist` Scraping & Default-On Analytics\nInside 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`.\n\nOn 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`).\n\nAt 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.\n\n`PRAGMA secure_delete`` 10,502` files of `98.6%` unzeroed freelist pages at `-wal`), and `90.6%–91.8%`` ON DELETE CASCADE` foreign keys and is skipped by `StateRuntime::delete_thread`.` 54+` days on Windows; up to `78` days including cancelled captures on macOS).`auth.json` on Windows:`codex_desktop_secret_auth_storage` explicitly excludes Windows.`1,502` Codex sessions`150.8 MB` and `186.8 MB`), even though `export_manifest.json` reported `\"omissions\": []`.\nTo keep every claim anchored strictly to verifiable bytes, our report explicitly documents **10 hypotheses we checked and ruled out**, including:\n\n`CodexWindowsSystemSerialObserved` (gate `1259783540`):` model_reroute` events`~/.codex/sessions/` JSONL records.`5h`/` 7d` quota exhaustion (ruled out because >71% of `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.\n\n```\ngit clone https://github.com/NeHumorist/codex-local-audit.git\ncd codex-local-audit\n\n# Node.js 22.15+ / 24+ (zero external dependencies)\nnode audit_codex.mjs\n\n# Or Python 3.10–3.13 via uv\nuv run --with zstandard python audit_codex.py\n```\n\nOn Windows without a global Node 24 install, you can invoke the Node 24 runtime already bundled with Codex Desktop:\n\n``` php\n$node24 = Get-ChildItem \"$env:LOCALAPPDATA\\OpenAI\\Codex\\runtimes\\cua_node\\*\\bin\\node.exe\" | Select-Object -First 1 -ExpandProperty FullName\n& $node24 .\\audit_codex.mjs\n```\n\nIf 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.", "url": "https://wpnews.pro/news/auditing-openai-codex-desktop-516-token-cutoffs-live-1-mib-git-diffs-and-sqlite", "canonical_source": "https://dev.to/nehumorist/auditing-openai-codex-desktop-516-token-cutoffs-live-1-mib-git-diffs-and-unzeroed-sqlite-c48", "published_at": "2026-11-23 16:27:46+00:00", "updated_at": "2026-11-23 16:43:42.998048+00:00", "lang": "en", "topics": ["ai-tools", "ai-agents", "ai-ethics", "ai-policy", "developer-tools"], "entities": ["OpenAI", "OpenAI Codex Desktop", "Denis Vaulin", "Oleksii Mai", "Statsig", "GitHub", "Windows", "macOS"], "also_reported_by": [], "takeaway": "Codex Desktop's turn-diff telemetry can ship up to 1 MiB of raw git diff to analytics while checking only is_zdr and a Statsig gate, so audit signed app.asar bundles and local logs rather than trusting settings toggles.", "recommendation": {"advice": "Audit desktop AI clients' signed bundles and local telemetry logs for diff-capture and registry-scraping paths, and verify opt-out flags are actually checked before relying on them.", "playbook": "production-ops", "playbook_url": "https://wpnews.pro/playbooks/production-ops"}, "alternates": {"html": "https://wpnews.pro/news/auditing-openai-codex-desktop-516-token-cutoffs-live-1-mib-git-diffs-and-sqlite", "markdown": "https://wpnews.pro/news/auditing-openai-codex-desktop-516-token-cutoffs-live-1-mib-git-diffs-and-sqlite.md", "text": "https://wpnews.pro/news/auditing-openai-codex-desktop-516-token-cutoffs-live-1-mib-git-diffs-and-sqlite.txt", "jsonld": "https://wpnews.pro/news/auditing-openai-codex-desktop-516-token-cutoffs-live-1-mib-git-diffs-and-sqlite.jsonld"}}