t3code icon indicating copy to clipboard operation
t3code copied to clipboard

No Play or Resume button shown after a failed stream-disconnect turn with an active goal

Open vibhor1102 opened this issue 15 hours ago • 2 comments

What happened

After a Codex turn failed with "The provider event stream closed unexpectedly. Retry the turn; if it keeps failing, check the provider and server logs.", the thread remained idle with an active goal (Goal set · 5.9m tokens · 8h 25m 40s ...), but neither the composer Play (Resume thread) button nor a Resume action on the goal banner appeared. The user had to send a manual message to resume the thread instead of using a one-click resume action.

image

Diagnosis

  1. Composer Play button (ComposerPrimaryActions):

    • ComposerPrimaryActions.tsx only renders the PlayIcon (Resume thread) button when canResume is true (canResumeThread(serverProjection, resumableRunId, hasHeldQueuedRuns)).
    • deriveResumableRunId in packages/client-runtime/src/state/threadExecution.ts only returns a RunId when run.status === "interrupted" or (run.status === "failed" and failure.class === "usage_limit").
    • Here, the latest run (ordinal: 25) ended with status: "failed" and failure.class: "unknown" (stream closed unexpectedly), so deriveResumableRunId returns null and canResume evaluates to false.
  2. Goal banner Resume button (goalNowItem / presentProviderGoal):

    • ThreadActivityBanners.tsx (goalNowItem) only renders the Resume (/goal resume) action when presentation.canResume && !isWorking.
    • presentProviderGoal in packages/client-runtime/src/state/threadExecution.ts sets canResume: goal.status !== "active" && goal.status !== "complete".
    • Because the turn failed mid-stream without transitioning the goal out of "active", goal.status remains "active", so only Clear is shown even though the thread is idle after a failed turn.

Steps to reproduce

  1. Start a Codex thread and set a /goal.
  2. Have the running turn fail with a stream/provider error (e.g., "The provider event stream closed unexpectedly...") so the run's status is "failed" with failure.class other than "usage_limit" while goal.status stays "active".
  3. Observe the idle thread: the composer shows the disabled submit arrow (no Play button) and the Goal set banner only shows Clear (no Resume).

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"

// Error turn item (orchestration_v2_projection_turn_items):
{
  "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

None found covering deriveResumableRunId / presentProviderGoal hiding both Play and Goal Resume after a non-usage_limit failed turn.

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 avatar Dec 01 '26 11:12 vibhor1102

Thanks for writing this up. It asks for new behaviour rather than reporting a defect, so it does not belong in the bug tracker and I'm closing it as not planned here. Feature ideas are discussed in Discussions: please post it there.

juliusmarminge avatar Dec 01 '26 13:12 juliusmarminge

I genuinely believe this is a bug/defect, not a new feature—the automated pipeline seems to have misevaluated it. The factory itself even reproduced it on main and opened #46746 as a fix before closing it with factory:fresh (and the error banner literally says "Retry the turn" while hiding both Play and Goal Resume).

@juliusmarminge Can you review it manually? If you still think it's a feature request, please leave a quick reason so I know not to retry opening it as an issue.

vibhor1102 avatar Dec 01 '26 13:12 vibhor1102