Codex Desktop: remote-compaction capacity error terminalizes one persistent goal while other tasks remain healthy
What version of Codex are you using?
- Codex Desktop on Windows
- codex-cli 0.144.1 (subagent logs also reported 0.144.2)
- ChatGPT-authenticated
- Active model: gpt-5.6-sol, reasoning effort xhigh
What issue are you seeing?
A long-running persistent /goal task repeatedly reaches remote compaction and fails with:
Error running remote compact task: Selected model is at capacity. Please try a different model.
It then also surfaces:
Selected model is at capacity. Please try a different model.
The recoverable capacity/compaction failure is converted into terminal control-plane state:
- The goal changes from
activetoblocked. - Automatic continuation stops and the user must send another message.
- The repository and shell remain healthy.
- Calling the goal creation API to replace/recover the task fails with:
cannot create a new goal because this thread has an unfinished goal; complete the existing goal first
- The API therefore simultaneously treats the goal as terminally blocked and unfinished.
- Subagents forked from the affected task can also receive the same capacity error.
This task has accumulated more than 25 million total goal tokens across many compactions. The failure has recurred for several hours.
Strong control observation
At the same time, on the same Windows machine, Codex Desktop app, authenticated account, and service window, a separate task in another repository continues to work normally with no capacity failure.
That makes blanket account quota exhaustion or a global model outage unlikely. The failure appears scoped to the long-lived task's remote-compaction/admission/recovery path. Available usage is not a sufficient explanation because the healthy control task continues normally.
Reproduction
- Start a persistent
/goalin Codex Desktop. - Run it long enough to cross many automatic compactions and automatic continuations.
- Let a remote compact request receive a transient model-capacity response.
- Observe the goal becoming
blockedand continuation stopping. - Send a user message to resume; work can proceed, but the goal API still reports stale blocked/unfinished state.
- Compare with another task on the same account/app, which remains healthy.
I can provide the affected task ID privately if maintainers need it.
Expected behavior
A transient remote-compaction capacity error must not terminalize a persistent goal.
- Retry with bounded backoff, or fall back to a supported local/dedicated compaction model.
- Keep the goal active across recoverable compaction/admission failures.
- If continuation cannot proceed immediately, preserve a recoverable state rather than
blocked. - Allow an explicitly resumed user turn to clear stale blocked state.
- Do not let
create_goaldeadlock on a state considered both blocked and unfinished. - Distinguish account quota, model admission, compact-endpoint capacity, and task-state failures in the UI.
Related issues
- #21343: remote compaction failures can strand long sessions (closed)
- #17014 and #19583: capacity errors despite available quota (closed)
- #21777: goal-aware compaction controls (open)
- #24418: local fallback / disable remote compaction (open)
- #24432: Desktop auto-compaction can stall long-running tasks (open)
This report is distinct because it includes a same-account healthy control task and the stale blocked + unfinished goal-state deadlock.
8 Comments
Potential duplicates detected. Please review them and close your issue if it is a duplicate.
Powered by Codex Action
I checked current
openai/codexmain after filing. There is no safe user-side local-compaction switch:codex-rs/core/src/compact.rs::should_use_remote_compact_taskreturns onlyprovider.supports_remote_compaction().codex-rs/core/src/tasks/compact.rsusesremote_compaction_v2only to selectcompact_remote_v2versus legacycompact_remote.remote_compaction_v2therefore does not select local compaction for ChatGPT auth.So the installed stable feature flag cannot safely mitigate this failure. The needed fix is provider/model/endpoint-aware fallback plus recovery of goal state after a failed compact request.
Source:
A working local mitigation is now proven on 0.144.1, though it relies on current implementation detail and should not replace a product fix.
Custom ChatGPT-authenticated provider:
Why it works on current main:
ModelProviderInfo::supports_remote_compaction()selects remote compaction only whenname == "OpenAI"(or Azure)Proof on Windows / CLI 0.144.1:
thread/compact/startcompletedmodel_provider: "openai-local-compact"compactedrecord with generated summaryremote compactevent/error appearedThis is deliberately a mitigation, not the desired API. A supported config such as
compaction = "auto|remote|local", with automatic remote-to-local fallback, would avoid depending on provider display-name identity.Additional reproducible evidence from Codex desktop 0.144.1 on Windows (2026-07-14): after remote compaction returned
Selected model is at capacity, the active goal persisted asstatus=blocked. Multiple explicit userresume/continuemessages and substantial successful tool work did not clear it; the goal API still reportsblockedwhile a queue-custodied repository proof is actively running. Work can continue only by ignoring the badge, and there is no resume/reopen/replacement path exposed by the goal API. The same account and selected model continued working normally in another repository task during this period, so the failure appears thread-specific rather than a global model-capacity outage.Expected behavior: a transient remote-compaction capacity failure should retry or fall back without converting the goal into terminal blocked state; otherwise the goal must be explicitly resumable and the UI/API state must reconcile with ongoing work.
Additional deterministic control-plane evidence from the same affected desktop task:
get_goalreturns the goal withstatus: "blocked".create_goalfails:cannot create a new goal because this thread has an unfinished goal; complete the existing goal first.update_goalaccepts onlycompleteorblocked.This leaves the task in a contradictory state: blocked enough to stop automatic continuation, but unfinished enough to forbid a replacement. The original transition followed a remote-compaction/model-capacity failure, while another concurrent Codex task remained healthy. A manual thread heartbeat can re-enter the task as a workaround, but the Goal state machine needs an idempotent resume/recovery transition after user input and compaction/capacity failure.
I observed a related capacity failure on a long-running ordinary local task (not a persistent
/goal), with an additional task-discovery failure.Environment:
26.707.9981.010.0.26200Observed behavior:
notLoaded.This broadens the failure beyond persistent goals: a capacity error can terminalize an ordinary long-running turn and also strand the intact task in a state that requires another model session to recover.
Expected behavior:
notLoadedtasks.The hidden-but-intact recovery aspect is also documented in #32508 and #27159.
I implemented and production-probed a structural fix on current upstream
main:Branch: https://github.com/adpena/codex/tree/fix/explicit-compaction-mode
Fork draft PR: https://github.com/adpena/codex/pull/1
Upstream compare: https://github.com/openai/codex/compare/main...adpena:codex:fix/explicit-compaction-mode
Commits:
2c5021c36,a0ad9a356The change introduces a typed
CompactionMode::{Auto, Local, Remote}authority and threads it through config, config locking, manual and automatic dispatch, app-server config reads, generated schemas, and tests.autopreserves existing behavior;localselects the existing local summarization path without spoofing provider identity.End-to-end production probe using the real
openaiprovider pluscompaction_mode=localpassed: first exact response, manual compaction, durable persistedcompactedandcontext_compactedrecords, then an exact post-compaction response. Production timings were 23.292s first turn, 5.156s compaction, 10.102s second turn, 39.628s total.The release app-server was built with zero warnings. Cold build: 111m27s, peak tree RSS ~9.49 GiB, peak private ~10.50 GiB. Warm build: 63m17s. Release binary: 348,788,224 bytes. After the production probe the service used 677,220,352 bytes RSS / 622,223,360 bytes private, 46 threads, 494 handles; that growth remains a profiling target.
The branch is rebased conflict-free onto current
main. The connected GitHub integration returned403 Resource not accessible by integrationwhen creating the upstream draft PR, and the localghtoken is expired. The fork draft PR and upstream compare above are the current review entrypoints.GitHub CLI authentication has now been refreshed and normal repository/issue access works, but opening the upstream draft PR from the existing fork branch still fails with: \GraphQL: adpena does not have the correct permissions to execute CreatePullRequest (createPullRequest)\. The tested implementation remains available at the fork draft PR https://github.com/adpena/codex/pull/1 and upstream compare https://github.com/openai/codex/compare/main...adpena:codex:fix/explicit-compaction-mode. A maintainer can open/import the branch or grant the integration permission needed to create the upstream PR.