You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Codex Web remote compaction fails with context_length_exceeded from mobile session #22890
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?
Open a Codex session from the ChatGPT mobile app and control Codex running on a laptop.
Continue a thread until context compaction is triggered automatically.
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.
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 context_length_exceeded #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.
Keeping this issue open because the report is specifically for the Codex Web / ChatGPT mobile-app control path, which does not appear to be covered by the exact existing context_length_exceeded report.
I am seeing the same failure family with Codex mobile/remote-control plus long-running /goal work: auto-compaction does not reliably compact and continue; it can leave the thread effectively broken or unrecoverable rather than surfacing a recoverable compact failure.
I added fresh Windows Codex Desktop /goal evidence on #24544, including a compact boundary and later token-accounting events that appear saturated/corrupted (input_tokens=0, total_tokens == model_context_window) in active goal sessions. The mobile symptom reported by the user appears to be the remote-control/mobile surface of the same underlying problem: compaction/replay/goal state is not being restored robustly after the compact step.
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.
Activity
bmanczak commentedon May 15, 2026
The automatic Issue Deduplicator workflow for this issue failed before it could post results.
Manual related-issue check:
context_length_exceededremote compaction error signature, but is reported for CLI/Windows.stream disconnected before completion.Keeping this issue open because the report is specifically for the Codex Web / ChatGPT mobile-app control path, which does not appear to be covered by the exact existing
context_length_exceededreport.2batsloverandomartifactromps-dotcom commentedon Jun 10, 2026
I am seeing the same failure family with Codex mobile/remote-control plus long-running
/goalwork: auto-compaction does not reliably compact and continue; it can leave the thread effectively broken or unrecoverable rather than surfacing a recoverable compact failure.I added fresh Windows Codex Desktop
/goalevidence on #24544, including a compact boundary and later token-accounting events that appear saturated/corrupted (input_tokens=0,total_tokens == model_context_window) in active goal sessions. The mobile symptom reported by the user appears to be the remote-control/mobile surface of the same underlying problem: compaction/replay/goal state is not being restored robustly after the compact step.Cross-reference: #24544 comment id
4665791415.etraut-openai commentedon Jun 29, 2026
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
/feedbackand open a new bug report.