Repository navigation
fix(ui): hide Stop when a failed worker is already gone - #145153
Conversation
Unify sidebar, Sessions, and chat Stop availability around the Gateway recovery action. Preserve provisioning cancellation and failed-worker cleanup, and keep the recorded failure visible when only restart remains.
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: needs maintainer review before merge. Reviewed September 11, 2026, 3:01 PM ET / 19:01 UTC (Revision 2). ClawSweeper reviewWhat this changesAligns cloud-worker Stop availability across session menus with the Gateway’s recovery decision and preserves Stop during provisioning, with regression coverage and lifecycle documentation. Merge readiness✅ Ready for maintainer review This remains a useful, focused fix: current main still exposes the incorrect menu choices, and no introduced correctness defect was found. The previous review’s empty finding list remains appropriate. Priority: P2 Review scores
Verification
How this fits togetherThe Gateway reports whether a failed session’s worker still needs cleanup. The Control UI uses that information to offer Stop or Restart in chat and session menus. flowchart TD
A[Worker environment state] --> B[Gateway recovery decision]
B --> C[Session placement data]
C --> D[Shared Stop action resolver]
D --> E[Sidebar and Sessions menus]
D --> F[Chat placement menu]
F --> G[Stop cleanup or Restart]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource +1, Tests +107, Docs +2. Total +110 across 9 files. View PR surface stats
Review metricsNone. Technical reviewBest possible solution: Keep all Stop surfaces on the shared resolver while preserving the Gateway’s cleanup decision, failure explanation, and existing Restart flow. Do we have a high-confidence way to reproduce the issue? Yes: current-main source exposes Stop for failed/restart placements and hides it during provisioning with an active run. The supplied before capture corroborates the first case; this review did not execute tests. Is this the best way to solve the issue? Yes: extending the existing shared resolver removes inconsistent menu decisions while retaining the established Gateway recovery and permission contracts. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 8a8d7a222f94. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (1 earlier review cycle)
|
|
Merged via squash.
|
Unify sidebar, Sessions, and chat Stop availability around the Gateway recovery action. Preserve provisioning cancellation and failed-worker cleanup, and keep the recorded failure visible when only restart remains.
What Problem This Solves
Fixes an issue where users opening a failed cloud session's sidebar or Sessions menu still saw Stop cloud worker… after the Gateway had confirmed the worker was gone. Choosing it could clear the failed placement back to local instead of stopping anything. The Sessions menu also hid Stop during provisioning when the initial turn was marked active.
Why This Change Was Made
All Stop surfaces now consume the shared action resolver and the Gateway's existing recovery decision. A failed placement with
recoveryAction: "restart"has nothing left to stop;stop-firstretains cleanup. The chat header uses that same resolver, and the Sessions menu uses its existing active-run constraint. Removed redundant fixed-method checks and corrected a stale comment. No backend lifecycle or persistence changes.User Impact
Sidebar, Sessions, and chat menus agree about when Stop is useful. Confirmed worker loss keeps its failure explanation and Restart action; pending cleanup and provisioning remain stoppable.
Evidence
recoveryAction: "restart"; the live sidebar still offered Stop before this fix.Synthetic before:
Synthetic after:
Post-merge validation: the canonical deployment succeeded on
f770fd99e0ce4c057630172472e4df1c878b551a(which contains this merge). Authenticated live-browser verification of the original archived failed session confirmed that the sidebar no longer offers Stop, the worker header offers Restart, and the missing-lease error and archive state remain visible. Independent read-only checks confirmed HTTP 200, a stable serving process, and the unchanged failed placement with no lease, worker device, attached sessions, or active turn. No session action was invoked. Live captures remain private; the images above use synthetic data.Complete CI run passed after a targeted retry of a runner package-cache import failure.