Context Size
What version of Codex CLI is running?
0.146.0
What subscription do you have?
Plus
Which model were you using?
gpt-5-6 Sol High
What platform is your computer?
Microsoft Windows NT 10.0.26200.0 x64
What terminal emulator and version are you using (if applicable)?
Windows Terminal/PowerShell
Codex doctor report
Windows PowerShell
Copyright (C) Microsoft Corporation. All rights reserved.
PS C:\WINDOWS\system32> codex doctor --json
{
"schemaVersion": 1,
"generatedAt": "1785568520s since unix epoch",
"overallStatus": "ok",
"codexVersion": "0.146.0",
"checks": {
"app_server.status": {
"id": "app_server.status",
"category": "app-server",
"status": "ok",
"summary": "background server is not running",
"details": {
"control socket": "C:\\Users\\vural\\.codex\\app-server-control\\app-server-control.sock",
"daemon state dir": "C:\\Users\\vural\\.codex\\app-server-daemon",
"mode": "ephemeral",
"pid file": "C:\\Users\\vural\\.codex\\app-server-daemon\\app-server.pid (missing)",
"settings": "C:\\Users\\vural\\.codex\\app-server-daemon\\settings.json (missing)",
"status": "not running",
"update-loop pid file": "C:\\Users\\vural\\.codex\\app-server-daemon\\app-server-updater.pid (missing)"
},
"remediation": null,
"durationMs": 0
},
"auth.credentials": {
"id": "auth.credentials",
"category": "auth",
"status": "ok",
"summary": "auth is configured",
"details": {
"auth file": "C:\\Users\\vural\\.codex\\auth.json",
"auth storage mode": "File",
"stored API key": "false",
"stored ChatGPT tokens": "true",
"stored agent identity": "false",
"stored auth mode": "chatgpt"
},
"remediation": null,
"durationMs": 0
},
"config.load": {
"id": "config.load",
"category": "config",
"status": "ok",
"summary": "config loaded",
"details": {
"CODEX_HOME": "C:\\Users\\vural\\.codex",
"config.toml": "C:\\Users\\vural\\.codex\\config.toml",
"config.toml parse": "ok",
"cwd": "C:\\WINDOWS\\system32",
"enabled feature flags": "<redacted>",
"feature flag overrides": "none",
"feature flags enabled": "38",
"log dir": "C:\\Users\\vural\\.codex\\log",
"mcp servers": "2",
"model": "gpt-5.6-sol",
"model provider": "openai",
"sqlite home": "C:\\Users\\vural\\.codex"
},
"remediation": null,
"durationMs": 0
},
"git.environment": {
"id": "git.environment",
"category": "git",
"status": "ok",
"summary": "git executable not found",
"details": {
"PATH git entries": "0",
"repo detected": "false",
"selected git": "not found"
},
"remediation": null,
"durationMs": 12
},
"installation": {
"id": "installation",
"category": "install",
"status": "ok",
"summary": "installation looks consistent",
"details": {
"PATH codex #1": "C:\\Users\\vural\\AppData\\Roaming\\npm\\codex",
"PATH codex #2": "C:\\Users\\vural\\AppData\\Roaming\\npm\\codex.cmd",
"PATH codex entries": "2",
"current executable": "C:\\Users\\vural\\AppData\\Roaming\\npm\\node_modules\\@openai\\codex\\node_modules\\@openai\\codex-win32-x64\\vendor\\x86_64-pc-windows-msvc\\bin\\codex.exe",
"install context": "npm (package C:\\Users\\vural\\AppData\\Roaming\\npm\\node_modules\\@openai\\codex\\node_modules\\@openai\\codex-win32-x64\\vendor\\x86_64-pc-windows-msvc, bin C:\\Users\\vural\\AppData\\Roaming\\npm\\node_modules\\@openai\\codex\\node_modules\\@openai\\codex-win32-x64\\vendor\\x86_64-pc-windows-msvc\\bin, resources C:\\Users\\vural\\AppData\\Roaming\\npm\\node_modules\\@openai\\codex\\node_modules\\@openai\\codex-win32-x64\\vendor\\x86_64-pc-windows-msvc\\codex-resources, path C:\\Users\\vural\\AppData\\Roaming\\npm\\node_modules\\@openai\\codex\\node_modules\\@openai\\codex-win32-x64\\vendor\\x86_64-pc-windows-msvc\\codex-path)",
"managed by bun": "false",
"managed by npm": "true",
"managed by pnpm": "false",
"managed package root": "C:\\Users\\vural\\AppData\\Roaming\\npm\\node_modules\\@openai\\codex",
"npm update target": "C:\\Users\\vural\\AppData\\Roaming\\npm\\node_modules\\@openai\\codex"
},
"remediation": null,
"durationMs": 460
},
"mcp.config": {
"id": "mcp.config",
"category": "mcp",
"status": "ok",
"summary": "MCP configuration is locally consistent",
"details": {
"configured servers": "2",
"disabled servers": "0",
"stdio servers": "1",
"streamable_http servers": "1"
},
"remediation": null,
"durationMs": 3381
},
"network.env": {
"id": "network.env",
"category": "network",
"status": "ok",
"summary": "network-related environment looks readable",
"details": {
"proxy env vars": "none"
},
"remediation": null,
"durationMs": 0
},
"network.provider_reachability": {
"id": "network.provider_reachability",
"category": "reachability",
"status": "ok",
"summary": "active provider endpoints are reachable over HTTP",
"details": {
"ChatGPT base URL": "https://chatgpt.com/backend-api/ reachable (HTTP 403)",
"reachability mode": "ChatGPT auth"
},
"remediation": null,
"durationMs": 120
},
"network.websocket_reachability": {
"id": "network.websocket_reachability",
"category": "websocket",
"status": "ok",
"summary": "Responses WebSocket handshake succeeded",
"details": {
"DNS": "1 IPv4, 0 IPv6, first IPv4",
"auth mode": "chatgpt",
"connect timeout": "15000 ms",
"endpoint": "ws://127.0.0.1:8045/v1/<redacted>",
"handshake result": "HTTP 101 Switching Protocols",
"model provider": "openai",
"models etag present": "true",
"provider name": "OpenAI",
"proxy env vars": "none",
"reasoning header": "false",
"server model present": "false",
"supports websockets": "true",
"wire API": "responses"
},
"remediation": null,
"durationMs": 1000
},
"runtime.provenance": {
"id": "runtime.provenance",
"category": "runtime",
"status": "ok",
"summary": "running npm on windows-x86_64",
"details": {
"commit": "unknown",
"current executable": "C:\\Users\\vural\\AppData\\Roaming\\npm\\node_modules\\@openai\\codex\\node_modules\\@openai\\codex-win32-x64\\vendor\\x86_64-pc-windows-msvc\\bin\\codex.exe",
"install method": "npm (package C:\\Users\\vural\\AppData\\Roaming\\npm\\node_modules\\@openai\\codex\\node_modules\\@openai\\codex-win32-x64\\vendor\\x86_64-pc-windows-msvc, bin C:\\Users\\vural\\AppData\\Roaming\\npm\\node_modules\\@openai\\codex\\node_modules\\@openai\\codex-win32-x64\\vendor\\x86_64-pc-windows-msvc\\bin, resources C:\\Users\\vural\\AppData\\Roaming\\npm\\node_modules\\@openai\\codex\\node_modules\\@openai\\codex-win32-x64\\vendor\\x86_64-pc-windows-msvc\\codex-resources, path C:\\Users\\vural\\AppData\\Roaming\\npm\\node_modules\\@openai\\codex\\node_modules\\@openai\\codex-win32-x64\\vendor\\x86_64-pc-windows-msvc\\codex-path)",
"platform": "windows-x86_64",
"version": "0.146.0"
},
"remediation": null,
"durationMs": 0
},
"runtime.search": {
"id": "runtime.search",
"category": "search",
"status": "ok",
"summary": "search is OK (bundled)",
"details": {
"search command": "C:\\Users\\vural\\AppData\\Roaming\\npm\\node_modules\\@openai\\codex\\node_modules\\@openai\\codex-win32-x64\\vendor\\x86_64-pc-windows-msvc\\codex-path\\rg.exe",
"search command readiness": "file exists",
"search provider": "bundled"
},
"remediation": null,
"durationMs": 0
},
"sandbox.helpers": {
"id": "sandbox.helpers",
"category": "sandbox",
"status": "ok",
"summary": "sandbox configuration is readable",
"details": {
"approval policy": "Never",
"codex-linux-sandbox helper": "none",
"execve wrapper helper": "none",
"filesystem sandbox": "unrestricted",
"network sandbox": "enabled"
},
"remediation": null,
"durationMs": 0
},
"state.paths": {
"id": "state.paths",
"category": "state",
"status": "ok",
"summary": "state paths and databases are inspectable",
"details": {
"CODEX_HOME": "C:\\Users\\vural\\.codex (dir)",
"active rollout files": "394 files, 33557213988 total bytes, 85170593 average bytes",
"archived rollout files": "0 files, 0 total bytes, 0 average bytes",
"goals DB": "C:\\Users\\vural\\.codex\\goals_1.sqlite (file)",
"goals DB integrity": "ok",
"log DB": "C:\\Users\\vural\\.codex\\logs_2.sqlite (file)",
"log DB integrity": "ok",
"log dir": "C:\\Users\\vural\\.codex\\log (dir)",
"memories DB": "C:\\Users\\vural\\.codex\\memories_1.sqlite (file)",
"memories DB integrity": "ok",
"sqlite home": "C:\\Users\\vural\\.codex (dir)",
"state DB": "C:\\Users\\vural\\.codex\\state_5.sqlite (file)",
"state DB integrity": "ok",
"thread history DB": "C:\\Users\\vural\\.codex\\thread_history_1.sqlite (missing)",
"thread history DB integrity": "skipped (missing)"
},
"remediation": null,
"durationMs": 3370
},
"state.rollout_db_parity": {
"id": "state.rollout_db_parity",
"category": "threads",
"status": "ok",
"summary": "rollout files and state DB thread inventory agree",
"details": {
"default model provider": "openai",
"rollout DB active files": "394",
"rollout DB active rows": "394",
"rollout DB archive mismatches": "0",
"rollout DB archived files": "0",
"rollout DB archived rows": "0",
"rollout DB duplicate DB paths": "0",
"rollout DB duplicate rollout thread ids": "0",
"rollout DB malformed file names": "0",
"rollout DB missing active rows": "0",
"rollout DB missing archived rows": "0",
"rollout DB model providers": "local-proxy=360, openai=34",
"rollout DB rows": "394",
"rollout DB scan cap reached": "false",
"rollout DB scan errors": "0",
"rollout DB sources": "subagent:thread_spawn=247, cli=128, vscode=19",
"rollout DB stale rows": "0"
},
"remediation": null,
"durationMs": 300
},
"system.environment": {
"id": "system.environment",
"category": "system",
"status": "ok",
"summary": "OS language tr-TR",
"details": {
"EDITOR": "not set",
"VISUAL": "not set",
"os": "Windows 10.0.26200 (Windows 11 Professional) [64-bit]",
"os language": "tr-TR",
"os type": "Windows",
"os version": "10.0.26200"
},
"remediation": null,
"durationMs": 1
},
"terminal.env": {
"id": "terminal.env",
"category": "terminal",
"status": "ok",
"summary": "terminal metadata was detected",
"details": {
"color output": "enabled",
"console input code page": "857",
"console output code page": "857",
"stderr console mode": "0x00000007 (VT processing: true)",
"stderr is terminal": "true",
"stdin is terminal": "true",
"stdout console mode": "0x00000007 (VT processing: true)",
"stdout is terminal": "true",
"terminal": "unknown",
"terminal size": "120x31"
},
"remediation": null,
"durationMs": 0
},
"terminal.title": {
"id": "terminal.title",
"category": "title",
"status": "ok",
"summary": "terminal title default",
"details": {
"terminal title activity": "true",
"terminal title items": "activity, project-name",
"terminal title project source": "cwd",
"terminal title project value": "system32",
"terminal title source": "default"
},
"remediation": null,
"durationMs": 0
},
"updates.status": {
"id": "updates.status",
"category": "updates",
"status": "ok",
"summary": "update configuration is locally consistent",
"details": {
"cached latest version": "0.146.0",
"check for update on startup": "true",
"last checked at": "2026-08-01T06:56:59.035422200Z",
"latest version": "0.146.0",
"latest version status": "current version is not older",
"npm update target": "C:\\Users\\vural\\AppData\\Roaming\\npm\\node_modules\\@openai\\codex",
"update action": "npm install -g @openai/codex",
"version cache": "C:\\Users\\vural\\.codex\\version.json"
},
"remediation": null,
"durationMs": 2061
}
}
}
PS C:\WINDOWS\system32>
What issue are you seeing?
Compaction repeatedly preserves large image payloads, reducing available context
In the latest compaction window (242), the preserved history contains 66 images whose combined image_url payload size is approximately 49.9 MB.
Codex 0.146 limits compacted text to a 64K token budget, but images appear to be counted as zero tokens while still being preserved alongside user messages.
As a result, every compaction carries the same old images forward again. The image payload continues occupying the preserved context, while the usable space for new messages gradually becomes smaller after each compaction.
Expected behavior:
Images should either be included in the compaction budget, deduplicated, summarized, or removed when they are no longer required.
Actual behavior:
Old image payloads are repeatedly preserved without affecting the token calculation, causing progressive context-space exhaustion.
What steps can reproduce the bug?
Compaction retains historical images and leaves progressively less context
Codex CLI 0.146.0 repeatedly preserves full base64 input_image data inside compacted replacement_history.
Measured in one session:
- Compactions: 242
- Retained images: 66
- Latest compacted record: 50.2 MB
- Rollout file: 8.1 GB
- Context left after compaction decreased from approximately 35% to 15%, then 10%
compact_remote_v2.rs counts images as zero tokens but still retains them. This causes context and disk usage to grow after every compaction.
Expected: old images should be removed, summarized or replaced with lightweight references during compaction.
What is the expected behavior?
Compaction retains historical images and leaves progressively less context
Codex CLI 0.146.0 repeatedly preserves full base64 input_image data inside compacted replacement_history.
Measured in one session:
- Compactions: 242
- Retained images: 66
- Latest compacted record: 50.2 MB
- Rollout file: 8.1 GB
- Context left after compaction decreased from approximately 35% to 15%, then 10%
compact_remote_v2.rs counts images as zero tokens but still retains them. This causes context and disk usage to grow after every compaction.
Expected: old images should be removed, summarized or replaced with lightweight references during compaction.
Additional information
_No response_
2 Comments
Potential duplicates detected. Please review them and close your issue if it is a duplicate.
Powered by Codex Action
?