Skip to content

Desktop Computer Use thread becomes unrecoverable after appshot/image history poisons remote compaction #28150

Closed

Description

@yuwei-x

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:

  1. The rollout JSONL grew to about 1.1GB.
  2. Opening the thread triggered an Electron main-process crash loop: RangeError: Invalid string length.
  3. 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.
  4. After malformed image data was repaired/removed, remote compaction failed with: Error running remote compact task: Image poisoning.
  5. 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:

  1. Start a Codex Desktop thread.
  2. Use Computer Use heavily against a remote desktop or VDI window for a long session.
  3. Let the thread accumulate many screenshot/appshot/tool-call events and repeated retries.
  4. Continue until auto-compaction is triggered.
  5. 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.

Activity

  1. added
    appIssues related to the Codex desktop app
    on Jun 14, 2026
  2. added
    bugSomething isn't working
    contextIssues related to context management (including compaction)
    sessionIssues involving session (thread) management, resuming, forking, naming, archiving
    on Jun 14, 2026
  3. etraut-openai commented on Jun 29, 2026

    @etraut-openai
    Contributor

    Thanks for reporting this problem. Until recently, Codex used a separate endpoint and server-side logic for compaction. We recently switched to a more robust approach where the compaction logic is moved locally using the same endpoint as normal turns. This eliminates "remote compaction" errors and increases the stability and reliability of compaction operations. If you see further problems with compaction, please use /feedback and open a new bug report.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    appIssues related to the Codex desktop appbugSomething isn't workingcomputer-usecontextIssues related to context management (including compaction)sessionIssues involving session (thread) management, resuming, forking, naming, archiving

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions