Desktop Computer Use thread becomes unrecoverable after appshot/image history poisons remote compaction
What version of the Codex App are you using (From “About Codex” dialog)?
26.609.41114
What subscription do you have?
ChatGPT Pro
What platform is your computer?
Darwin 25.4.0 arm64 arm
What issue are you seeing?
A long-running Codex Desktop thread using Computer Use / remote desktop control became unrecoverable after accumulating screenshots, appshots, image references, and large tool outputs.
Failure chain:
- The rollout JSONL grew to about 1.1GB.
- Opening the thread triggered an Electron main-process crash loop:
RangeError: Invalid string length. - After manually reducing inline image payloads, the thread failed with invalid image URL errors: expected a base64-encoded data URI with an image MIME type.
- After malformed image data was repaired/removed, remote compaction failed with:
Error running remote compact task: Image poisoning. - The latest visible turn was completed, but Codex Desktop still marked the thread as
systemError.
Key observation: removing only inline data:image/... payloads was not enough. Non-inline image references such as local_images and <appshot ... image="...png"> also appeared to poison remote compaction.
What steps can reproduce the bug?
This came from a real long-running Computer Use / VDI workflow rather than a small synthetic repro.
Approximate reproduction shape:
- Start a Codex Desktop thread.
- Use Computer Use heavily against a remote desktop or VDI window for a long session.
- Let the thread accumulate many screenshot/appshot/tool-call events and repeated retries.
- Continue until auto-compaction is triggered.
- Reopen or continue the thread.
Local session inspection found many function_call_output, mcp_tool_call_end, reasoning, token_count, local_images, and appshot image references. Manual recovery required preserving the original rollout, removing inline images, clearing local_images, removing appshot image references, removing inflated token-count events, and minimizing active replay context to user/assistant-visible messages plus turn state. The active session then shrank from about 1.1GB to about 1.2MB and became parseable again.
What is the expected behavior?
Codex should not let one image-heavy Computer Use thread become unrecoverable.
Expected behavior:
- Do not persist large screenshots/tool images inline in replayable thread history.
- Store image blobs out-of-line and replay only lightweight references or summaries.
- Exclude image-bearing
local_images, appshots, and screenshot references from remote compact input. - Cap or summarize large tool outputs before persistence.
- If remote compaction rejects image content, fall back to text-only compaction.
- Provide a built-in safe-resume / repair-thread path that preserves the original rollout but rebuilds active context from safe text-only history.
Additional information
This seems related to #18629, #22004, and #16605, but the additional point is that non-inline image references can still poison compaction after inline base64 payloads are removed.
No raw rollout JSONL, screenshots, local paths, session IDs, or business/private data are included here because the affected workflow involved remote desktop screenshots.
This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗