codex - 💡(How to fix) Fix Codex Web remote compaction fails with context_length_exceeded from mobile session

Official PRs (…)
ON THIS PAGE

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…

Error Message

While using Codex Web from the ChatGPT mobile app to control a Codex session running on a Mac laptop, automatic context compaction failed and the thread showed this error: Error running remote compact task: { "error": { The UI showed "Compacting context" immediately before the error. The user had tapped "Please keep going"; instead of compacting the context and continuing, the session surfaced the raw context_length_exceeded response.

Root Cause

  • Host laptop platform: macOS 26.4.1, Darwin 25.4.0 arm64 arm.
  • Local Codex CLI version on the host: codex-cli 0.120.0.
  • Mobile client: ChatGPT app on a phone, controlling the Codex session remotely.
  • Active model/reasoning setting shown in the screenshot: 5.5 High.
  • Screenshot time: 2026-05-15 around 21:55 local time.
  • Possibly related to CLI report #20866, but this report is specifically for the Codex Web/mobile control path.
  • Suggested labels: bug, codex-web, context, mobile. Reporter account could not apply labels because the repository rejected AddLabelsToLabelable for this account.

Code Example

Error running remote compact task: {
  "error": {
    "message": "Your input exceeds the context window of this model. Please adjust your input and try again.",
    "type": "invalid_request_error",
    "param": "input",
    "code": "context_length_exceeded"
  }
}
RAW_BUFFERClick to expand / collapse

What issue are you seeing?

While using Codex Web from the ChatGPT mobile app to control a Codex session running on a Mac laptop, automatic context compaction failed and the thread showed this error:

Error running remote compact task: {
  "error": {
    "message": "Your input exceeds the context window of this model. Please adjust your input and try again.",
    "type": "invalid_request_error",
    "param": "input",
    "code": "context_length_exceeded"
  }
}

The UI showed "Compacting context" immediately before the error. The user had tapped "Please keep going"; instead of compacting the context and continuing, the session surfaced the raw context_length_exceeded response.

What steps can reproduce the bug?

  1. Open a Codex session from the ChatGPT mobile app and control Codex running on a laptop.
  2. Continue a thread until context compaction is triggered automatically.
  3. In this case, the thread included Gmail tool calls and attachment-read output immediately before compaction. The visible UI redacted the tool output, so the exact payload is not included here.
  4. Ask Codex to keep going after compaction starts.

Observed result: remote compaction fails with context_length_exceeded.

Session/thread identifier visible in local attachment path: 019e2d36-f1ac-7630-8c1a-630348907a4e.

What is the expected behavior?

Codex Web should compact the thread successfully, or if the context is too large to compact, it should recover with an actionable UI state instead of failing the compaction request with context_length_exceeded.

Additional information

  • Host laptop platform: macOS 26.4.1, Darwin 25.4.0 arm64 arm.
  • Local Codex CLI version on the host: codex-cli 0.120.0.
  • Mobile client: ChatGPT app on a phone, controlling the Codex session remotely.
  • Active model/reasoning setting shown in the screenshot: 5.5 High.
  • Screenshot time: 2026-05-15 around 21:55 local time.
  • Possibly related to CLI report #20866, but this report is specifically for the Codex Web/mobile control path.
  • Suggested labels: bug, codex-web, context, mobile. Reporter account could not apply labels because the repository rejected AddLabelsToLabelable for this account.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

codex - 💡(How to fix) Fix Codex Web remote compaction fails with context_length_exceeded from mobile session