Stream-disconnect turn failure leaves thread stuck with disabled composer and active goal despite "Retry the turn" prompt #47988
What happened#
I originally opened this in #46728, which got false-positively closed by the automated classifier as a feature request shortly after #46746 closed, so I am opening this new one. Sorry if this behavior is deliberate—if it is, please drop a quick reason while closing so I know not to reopen.
When a Codex turn fails mid-stream with "The provider event stream closed unexpectedly. Retry the turn; if it keeps failing, check the provider and server logs.", T3 Code explicitly instructs the user to retry the turn, but leaves the thread in a broken recovery state:
- The composer primary action is a disabled submit arrow instead of the existing Play (Resume thread) button.
- The goal banner stays stuck in "Goal set" (status: "active") on an idle thread with only Clear and no Resume button.
This is a defect in existing turn-recovery state handling (not a request for new UI or new behavior): both resume controls already exist, and the error banner already tells the user to retry, but the failure state breaks both checks.
Diagnosis#
deriveResumableRunId(packages/client-runtime/src/state/threadExecution.ts) only treats a run as resumable whenrun.status === "interrupted"or (run.status === "failed"andfailure.class === "usage_limit"). A stream-disconnect failure (status: "failed",failure.class: "unknown") returnsnull, socanResumeThreadisfalseandComposerPrimaryActionsdisables the composer button instead of showing Play (Resume thread).presentProviderGoal(packages/client-runtime/src/state/threadExecution.ts) setscanResume: goal.status !== "active" && goal.status !== "complete". Because mid-stream process death does not transition the goal out of"active",goalNowItem(apps/web/src/components/chat/ThreadActivityBanners.tsx) hidesResumeeven though the thread is idle after a failed turn.- Already reproduced on
mainin PR #46746 (fix(client-runtime): offer Resume after a turn fails because the provider stream closed), which was closed viafactory:freshafter 3 review rounds before a replacement PR was opened.
Steps to reproduce#
- Start a Codex thread and set a
/goal. - Kill the turn's
codex app-serverprocess (or trigger a stream disconnect) so the turn fails with "The provider event stream closed unexpectedly. Retry the turn; if it keeps failing, check the provider and server logs.". - Observe the idle thread: the error banner asks to retry the turn, yet the composer button is disabled (no Play button) and the
Goal setbanner only offersClear(noResume).
Version#
0.1.14-nightly.20261201.5530
Environment#
Linux x64 (7.3.5-200.fc44.x86_64), Node v24.22.1, T3 Code Desktop 0.1.14-nightly.20261201.5530, Codex (gpt-6.2-sol)
Evidence#
// Latest run in statev2.sqlite (orchestration_v2_projection_runs): ordinal 25, status "failed"
{
"class": "unknown",
"message": "The provider event stream closed unexpectedly. Retry the turn; if it keeps failing, check the provider and server logs.",
"code": null,
"retryable": null
}
Related issues#
#46728 (closed as factory:feature-request 8m after #46746 closed with factory:fresh), #46746 (prior fix PR that reproduced this on main)
Fix applied or workaround#
Send a manual message (e.g. continue) in the composer to start a new turn under the active goal.
Filed by#
Antigravity (Gemini 4 Hydrogen (Medium)) via t3 triage
vibhor1102(GitHub profile, opens in a new tab) added labelsvia-triage
tanstack-source added labelsbug
Sign in to join this conversation.