Skip to content

fix(ui): hide Stop when a failed worker is already gone - #145153

Merged
steipete merged 1 commit into
mainfrom
codex/worker-stop-recovery
Sep 11, 2026
Merged

steipete merged 1 commit into
mainfrom
codex/worker-stop-recovery

Conversation

@steipete

@steipete steipete commented Sep 11, 2026 •

Copy link
Copy Markdown
Contributor

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-first retains 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

  • Live read-only SSH/Gateway inspection confirmed a failed, archived session with no lease, no worker device, no attachments, no active run, and recoveryAction: "restart"; the live sidebar still offered Stop before this fix.
  • Regression reproduced before the change: the archived worker E2E failed because Stop was present; the provisioning menu test failed because Stop was absent.
  • 107 focused unit tests passed, including offline-device and provisioning behavior.
  • Full local changed-file checks passed: core-test and UI typechecking, lint, i18n, dead exports, formatting, and repository guards.
  • Independent review through P2: clean. A proposed access mismatch was disproved against the single-method Stop contract and independently rechecked.
  • All 6 browser E2E cases passed against the production UI build. The new cases cover header, sidebar, Sessions, archived recovery, pending cleanup, and the exact reclaim request.

Synthetic before:

Before: archived failed worker still offers Stop

Synthetic after:

After: failure remains visible and redundant Stop is absent

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.

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.
@clawsweeper

clawsweeper Bot commented Sep 11, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation app: web-ui App: web-ui gateway Gateway runtime labels Sep 11, 2026
@steipete
steipete marked this pull request as ready for review September 11, 2026 18:42
@openclaw-barnacle openclaw-barnacle Bot added size: S maintainer Maintainer-authored PR labels Sep 11, 2026
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Sep 11, 2026
@clawsweeper

clawsweeper Bot commented Sep 11, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed September 11, 2026, 3:01 PM ET / 19:01 UTC (Revision 2).

ClawSweeper review

What this changes

Aligns 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
Reviewed head: 233d0797a4d224f3c7f533a44d1651a1dc478021

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused repair with relevant visual evidence, meaningful regression coverage, and no actionable findings.
Proof confidence 🐚 platinum hermit (4/6) ✨ media proof bonus Sufficient (screenshot): Inspected synthetic before/after browser captures directly show the shared resolver’s intended sidebar change: redundant Stop disappears while failure and archive guidance remain. Reported production-UI browser cases supplement this with all three menus and pending-cleanup coverage; no provider-teardown claim is inferred.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (screenshot): Inspected synthetic before/after browser captures directly show the shared resolver’s intended sidebar change: redundant Stop disappears while failure and archive guidance remain. Reported production-UI browser cases supplement this with all three menus and pending-cleanup coverage; no provider-teardown claim is inferred.
Evidence reviewed 7 items Introduced change and checkout identity: The checkout matches pinned head 233d079. The merge-base comparison matches the supplied nine-file introduced delta; unrelated endpoint drift is excluded. The checkout remained clean and diff whitespace checks passed.
Existing recovery owner: The Gateway projects restart only when its existing environment-gone predicate succeeds; otherwise it projects stop-first. The UI consumes this established contract without changing teardown or persistence.
Shared action and permission contract: The resolver suppresses Stop only for failed/restart placements, retains cleanup otherwise, and always returns sessions.reclaim with operator.write. Its active-run restriction applies only to active placement, preserving provisioning cancellation. Passing this action to the existing access checker does not broaden permissions.
Findings None None.
Security None None.

How this fits together

The 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]
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Source +1, Tests +107, Docs +2. Total +110 across 9 files.

View PR surface stats
Area Files Added Removed Net
Source 6 15 14 +1
Tests 2 110 3 +107
Docs 1 2 0 +2
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 9 127 17 +110

Review metrics

None.

Technical review

Best 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.

Labels

Label justifications:

  • P2: Repairs misleading worker-recovery actions and missing provisioning cancellation in a bounded Control UI workflow.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (screenshot): Inspected synthetic before/after browser captures directly show the shared resolver’s intended sidebar change: redundant Stop disappears while failure and archive guidance remain. Reported production-UI browser cases supplement this with all three menus and pending-cleanup coverage; no provider-teardown claim is inferred.
  • proof: sufficient: Contributor real behavior proof is sufficient. Inspected synthetic before/after browser captures directly show the shared resolver’s intended sidebar change: redundant Stop disappears while failure and archive guidance remain. Reported production-UI browser cases supplement this with all three menus and pending-cleanup coverage; no provider-teardown claim is inferred.
  • proof: 📸 screenshot: Contributor real behavior proof includes screenshot evidence. Inspected synthetic before/after browser captures directly show the shared resolver’s intended sidebar change: redundant Stop disappears while failure and archive guidance remain. Reported production-UI browser cases supplement this with all three menus and pending-cleanup coverage; no provider-teardown claim is inferred.

Evidence

What I checked:

Likely related people:

  • steipete: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • jalehman: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

History

Review history (1 earlier review cycle)
  • reviewed 2026-09-11T18:47:34.078Z sha 233d079 :: needs maintainer review before merge. :: none

@steipete
steipete merged commit 9cf9f64 into main Sep 11, 2026
287 of 289 checks passed
@steipete
steipete deleted the codex/worker-stop-recovery branch September 11, 2026 19:07
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 12, 2026
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

app: web-ui App: web-ui docs Improvements or additions to documentation gateway Gateway runtime maintainer Maintainer-authored PR P2 Normal backlog priority with limited blast radius. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: S status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant