Repository navigation
fix(ui): label device workers correctly during startup - #135681
Conversation
Carry the existing startup target kind into the lazy and loaded UI status projections, and share target presentation between the chat header and stop confirmation. Active placement facts win; failed initial intent remains available for retry but cannot relabel a later startup. Keep the session-scoped reclaim operation, permissions, and worker lifecycle unchanged. Cover live and retained startup intent with UI regressions and matched synthetic browser proof. No config, protocol, or persistence change. Fixes #135575 Related: #132180 (node completion and execution outcomes review)
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: needs changes before merge. Reviewed September 1, 2026, 8:08 PM ET / September 2, 2026, 00:08 UTC. ClawSweeper reviewWhat this changesThe PR carries a session’s selected startup destination into Control UI status so pending paired-device sessions use device-specific worker labels in the chat header and stop confirmation. Merge readinessKeep open: the production fix correctly carries startup target intent to the shared presentation boundary, but an introduced cloud-case assertion expects text the helper cannot emit, so the new test fails before merge. Priority: P2 Review scores
Verification
How this fits togetherThe Control UI starts remote sessions through the Gateway and retains startup state until a worker becomes active. The chat header and reclaim confirmation consume that state to present the worker type before sending the existing session-scoped reclaim request. flowchart LR
A[Selected destination] --> B[Startup recovery]
B --> C[Startup status]
D[Active placement] --> E[Worker presentation]
C --> E
E --> F[Chat header]
E --> G[Stop confirmation]
G --> H[Session reclaim]
Before merge
Findings
Agent review detailsSecurityNone. PR surfaceSource +40, Tests +407, Docs +2. Total +449 across 16 files. View PR surface stats
Review metrics
Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Merge-risk optionsMaintainer options:
Copy recommended automerge instructionTechnical reviewBest possible solution: Retain the shared target-presentation resolver, correct the cloud expectation to “Stop cloud worker”, and preserve neutral wording only when a non-active target is genuinely unknown. Do we have a high-confidence way to reproduce the issue? Yes, source-reproducible: current main’s pending-device presentation falls through to cloud wording, and the introduced cloud test assertion deterministically conflicts with the branch’s resolver output. This read-only review did not execute the test. Is this the best way to solve the issue? No, not until the introduced cloud assertion is corrected. The production approach is the best narrow repair because it transports the already-owned target fact and centralizes the two display consumers. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against ab6cb8ca4401. LabelsLabel changes:
Label justifications:
EvidenceAcceptance criteria:
What I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
Merged and verifiedLanded through the native wrapper as f1cace5e351e625ed70ae9cb61b37addfadf2897, closing #135575 (device startup stop controls say cloud worker). Native review/artifact validation and hosted-CI prepare passed on the unchanged reviewed head. The first merge request was accepted; a moving-main post-merge observation caused the wrapper to stop before completion bookkeeping. After verifying the old process group had exited, native lock recovery and read-only reconciliation verified the exact attempted head against the actual landed tree and retained the receipt. No second merge request or bypass was issued. Pre-merge verification and review dispositionVerified head: 5a1d7143cee12e82e93418896a6fc1a1d7611bc0. CI run 33573441698, attempt 1 completed successfully on this exact head, including all three UI shards, all fourteen mocked UI E2E shards, the real-Gateway UI E2E job, i18n, build artifacts, and ClawSweeper finding and rank-up moveThe proposed cloud-action assertion change is not applicable. It infers the button text from the translation key rather than reading the catalog. At this exact head,
The confirmation resolves the The production-LOC item is acknowledged and justified: +65/-25, net +40; tests/support net +407 and docs +2. The existing startup owner must carry its target fact through both lazy and loaded status producers and across the header boundary. One shared resolver replaces the menu/confirmation decisions, respects active ownership, and excludes failed retry intent from a later startup. Inferring from provider IDs or adding a protocol/persistence field would be a worse repair. No smaller owner-boundary reduction was identified by either review. Root cause, behavior and proofPending placements deliberately lack an active runner, but the startup owner already has the selected destination. The old consumers discarded that fact and chose cloud copy. The fix preserves it for live initial handoffs, while retaining failed intent only for retry. The Local proof passed: 442 focused tests, 11 composer/restart sibling tests, UI test types, the actual changed-file gate, and the source-built Chromium flow. Twelve stale-intent regressions failed before correction. A matched current-main baseline at The inspected, synthetic-only before/after menu and confirmation images are attached in the PR body. The browser flow checks cancel → zero reclaim; confirm → exactly one session reclaim; late dispatch → zero initial sends and zero environment-destroy calls. This is real rendered Control UI/request-boundary proof with a synthetic Gateway, not physical-device teardown proof. No live operator service, state, credential or device identity was used. Broader sidebar/Sessions-page wording remains an explicitly separate follow-up; the node-completion PR #132180 is untouched. Exact local commands: node scripts/run-vitest.mjs ui/src/app/session-placement-startup.test.ts ui/src/app/session-placement-startup.stop.test.ts ui/src/app/session-placement-startup.disconnect.test.ts ui/src/pages/chat/chat-pane-placement-stop.test.ts ui/src/pages/chat/chat-pane-placement.test.ts ui/src/pages/chat/components/chat-pane-placement.test.ts ui/src/pages/chat/chat-view.test.tsnode scripts/run-vitest.mjs ui/src/pages/chat/chat-pane-placement-composer.test.ts ui/src/pages/chat/chat-pane-placement-restart.test.tsnode scripts/run-tsgo-core-test-shards.mjs uiOPENCLAW_CAPTURE_UI_PROOF=1 node scripts/run-vitest.mjs run --config test/vitest/vitest.ui-e2e.config.ts --configLoader runner ui/src/e2e/new-session-page.device-stop.e2e.test.tsnode scripts/check-changed.mjs --base eee230d0b763d30e737aaf0c28c7277aa30adcf9 --head HEAD -- docs/web/control-ui.md ui/src/app/session-placement-startup.runtime.ts ui/src/app/session-placement-startup.test.ts ui/src/app/session-placement-startup.ts ui/src/e2e/new-session-page.device-stop.e2e.test.ts ui/src/i18n/locales/en-session-placement.ts ui/src/pages/chat/chat-pane-header.ts ui/src/pages/chat/chat-pane-placement-stop.test.ts ui/src/pages/chat/chat-pane-placement.runtime.ts ui/src/pages/chat/chat-pane-placement.test.ts ui/src/pages/chat/chat-pane-placement.ts ui/src/pages/chat/chat-pane.test-support.ts ui/src/pages/chat/chat-view.test.ts ui/src/pages/chat/components/chat-pane-header.ts ui/src/pages/chat/components/chat-pane-placement.test.ts ui/src/pages/chat/components/chat-pane-placement.tsnode scripts/watch-pr-ci.mjs 135681 5a1d7143cee12e82e93418896a6fc1a1d7611bc0The native review/prepare/merge gates were used; exact landed-tree reconciliation succeeded. No direct-merge bypass was used. |
Carry the existing startup target kind into the lazy and loaded UI status projections, and share target presentation between the chat header and stop confirmation. Active placement facts win; failed initial intent remains available for retry but cannot relabel a later startup. Keep the session-scoped reclaim operation, permissions, and worker lifecycle unchanged. Cover live and retained startup intent with UI regressions and matched synthetic browser proof. No config, protocol, or persistence change. Fixes openclaw#135575 Related: openclaw#132180 (node completion and execution outcomes review)
Compose the placement control at the chat header owner instead of forwarding nine placement props through the view. Reuse the startup status already prepared for the render, while keeping the fresh action-time reclaim read. Resolve worker copy once and consume presentation-ready text in both surfaces. Keep all 28 copy permutations while reducing redundant modal/RPC test flows from 38 to 13. Preserve active-owner precedence, failed retry intent, exact wording, permissions, offline behavior, and the session reclaim lifecycle. Related: #135681 (device worker startup labeling) Related: #135575 (device startup stop controls say cloud worker)
Compose the placement control at the chat header owner instead of forwarding nine placement props through the view. Reuse the startup status already prepared for the render, while keeping the fresh action-time reclaim read. Resolve worker copy once and consume presentation-ready text in both surfaces. Keep all 28 copy permutations while reducing redundant modal/RPC test flows from 38 to 13. Preserve active-owner precedence, failed retry intent, exact wording, permissions, offline behavior, and the session reclaim lifecycle. Related: openclaw#135681 (device worker startup labeling) Related: openclaw#135575 (device startup stop controls say cloud worker)
Closes #135575 — device startup stop controls say “cloud worker”.
Related: #132180 (node completion and execution outcomes review). This is a separate, bounded UI follow-up; it does not change that PR's node-completion behavior.
Additional instructions
Maintainers can push to this same-repository branch.
What Problem This Solves
Fixes an issue where users starting a session on a paired device would see Stop cloud worker… in the chat placement menu and a cloud-worker confirmation while startup was still pending. The operation already used
sessions.reclaim; this is incorrect target presentation, not evidence of a physical device being destroyed incorrectly.Why This Change Was Made
Carry the startup owner's existing target kind through both its lazy and loaded status projections, then use one shared chat presentation helper for the header, menu and confirmation. Active placement facts take precedence. Failed startup records retain their original destination for retry, but that old intent must not label a later restart; only a live initial handoff supplies a startup hint. Unknown current targets use neutral worker wording.
This preserves current main's restart/recovery controls and all reclaim ordering, permission, offline, move, desktop and delivery behavior. It adds no provider-ID inference, configuration, persistence or protocol surface. The device confirmation also drops the misleading “after it reconnects” promise because offline Stop is disabled.
Production LOC: +65/-25 (net +40). Tests/support: +885/-478 (net +407), including a split of existing stop tests. Docs: +2/-0. Production growth carries the missing owner fact across both startup producers and the header boundary while consolidating duplicated presentation decisions; there is no parallel execution path.
User Impact
Explicit and automatic paired-device starts get device-specific wording before they become active. A retained failed prompt cannot mislabel a later startup on another target. Stop still targets the session through the existing reclaim lifecycle, and its unsent initial message remains available for review/retry.
The broader sidebar/Sessions-page and failed-composer cloud-specific wording is unchanged and remains a separate follow-up. The local Control UI guide was updated for the repaired chat behavior.
Evidence
eee230d0b763d30e737aaf0c28c7277aa30adcf9: the real Chromium flow fails withExpected: Stop device worker… / Received: Stop cloud worker…, after capturing the menu and confirmation.sessions.reclaim→ release a late active dispatch with zero initial sends and zeroenvironments.destroyrequests. The retained-message alert is visible and asserted.All visual data is synthetic, running through the real Control UI with a mocked Gateway. No live operator service, state, credential or paired-device identity was used. This is UI/request-boundary proof, not a physical-device teardown test. Every attached frame was inspected before upload.
Exact local proof commands