Repository navigation
fix(ui): offer desktop setup instead of Retry when Host Desktop is off - #177888
Conversation
|
🦞👀 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. What this changesThe chat Desktop panel offers Host Desktop setup instructions and authorized enablement instead of an ineffective Retry action. Example: A local macOS chat targets the Gateway host with desktop.host.enabled false and Screen Sharing running.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review Keep this PR open: it addresses a confirmed chat Desktop setup failure that remains on current main, and the prior import-cycle finding is resolved. Priority: P0 Before mergeNone. FindingsNone. Agent review detailsHow this fits togetherThe Control UI resolves the chat's desktop target through Gateway environment inventory, displays prerequisites, and delegates enablement to the existing runtime-config owner before requesting desktop observation. flowchart TD
A[Chat Desktop panel] --> B[Desktop source owner]
B --> C[Gateway environment inventory]
C --> D[Host setup guidance]
D --> E[Runtime config owner]
E --> F[Gateway config patch]
F --> B
B --> G[Desktop observation]
Technical reviewBest possible solution: Retain the inline setup flow, shared enablement operation, and exact Gateway targeting while letting the existing config owner enforce writes. Do we have a high-confidence way to reproduce the issue? Current-main source establishes the disabled-host fallback, corroborated by the linked report and contributor's before-change browser reproduction; this review ran no target code. Is this the best way to solve the issue? Reusing setup discovery and the existing config-write owner addresses the failing entry point without changing desktop defaults, OS permissions, or unrelated target selection. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 109271a97cb3. Provenance checked
TestingProof path: shipped entry point. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource +238, Tests +196, Docs +3. Total +437 across 16 files. Added test files: 1. View PR surface stats
Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. LabelsLabel changes:
Label justifications:
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment HistoryReview history (1 earlier review cycle)
Reviewed October 19, 2026, 10:34 PM ET / October 20, 2026, 02:34 UTC (Revision 2). |
- The chat Desktop panel asks environments.list for desktopSetup only when its unresolved automatic target is the Gateway host. - The panel says desktop access is not enabled on the Gateway host and that it shares the Gateway host's screen, shows setup steps worded for the Gateway host plus account and network notes, and offers Enable desktop access when the connection can patch config (else the administrator hint) or Check again, then re-reads inventory and connects the Gateway desktop. - Systems and the panel share the setup state selection and the desktop.host.enabled patch helper; other targets, document mode and a failed setup check keep desktop.sourceUnavailable. - The setup helper declares its own runtime-config shape and imports nothing from desktop-panel-inputs.ts, so the type import runs one way. - Docs mention the chat panel path.
0a3310d to
6740158
Compare
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
#177888) - The chat Desktop panel asks environments.list for desktopSetup only when its unresolved automatic target is the Gateway host. - The panel says desktop access is not enabled on the Gateway host and that it shares the Gateway host's screen, shows setup steps worded for the Gateway host plus account and network notes, and offers Enable desktop access when the connection can patch config (else the administrator hint) or Check again, then re-reads inventory and connects the Gateway desktop. - Systems and the panel share the setup state selection and the desktop.host.enabled patch helper; other targets, document mode and a failed setup check keep desktop.sourceUnavailable. - The setup helper declares its own runtime-config shape and imports nothing from desktop-panel-inputs.ts, so the type import runs one way. - Docs mention the chat panel path. Co-authored-by: RomneyDa <[email protected]>
Backport the trusted translations for the eight desktop setup strings introduced by #177888 and regenerate beta-line locale metadata. Co-authored-by: RomneyDa <[email protected]>
openclaw#177888) - The chat Desktop panel asks environments.list for desktopSetup only when its unresolved automatic target is the Gateway host. - The panel says desktop access is not enabled on the Gateway host and that it shares the Gateway host's screen, shows setup steps worded for the Gateway host plus account and network notes, and offers Enable desktop access when the connection can patch config (else the administrator hint) or Check again, then re-reads inventory and connects the Gateway desktop. - Systems and the panel share the setup state selection and the desktop.host.enabled patch helper; other targets, document mode and a failed setup check keep desktop.sourceUnavailable. - The setup helper declares its own runtime-config shape and imports nothing from desktop-panel-inputs.ts, so the type import runs one way. - Docs mention the chat panel path.
Closes #174368
What Problem This Solves
Fixes: the chat Desktop panel says "The requested desktop is unavailable. Retry when the machine is ready." and offers only Retry when the Gateway's Host Desktop is not set up, so retrying can never help (repro in the issue).
User Impact
User impact: opening Desktop in a local chat on a Gateway without Host Desktop now says "Desktop access is not enabled on the Gateway host." and that the panel shares the Gateway host's screen, not the screen of the device running the browser, then fixes it in place. When no screen-sharing server is running, the panel shows the steps for the Gateway host (on macOS: System Settings, General, Sharing on the Gateway host Mac) and Check again, which shows Refreshing while it re-checks. When Screen Sharing is already running, it says which account the sign-in will use (a macOS user account on the Gateway host, or the desktop server's own password elsewhere) and offers Enable desktop access in OpenClaw to connections that can change config; everyone else is told that a Gateway administrator can enable it (with Check again). Both states note that the screen-sharing or desktop server may be reachable from other devices on the network. Once Host Desktop is on, the panel re-checks and connects to the same Gateway desktop without leaving the chat. Other machines, and offline or starting targets, keep today's message.
Why This Change Was Made
For the Gateway host, the chat panel now asks the Gateway for the same Host Desktop setup check the Systems page uses and renders that setup state inside the panel, worded for the Gateway host.
The panel only accepted environments that already advertise a desktop. A Gateway with
desktop.host.enabledoff never advertises one, so the panel fell through to the generic notice. The setup discovery (environments.listwithincludeDesktopSetup), the setup state selection and the narrowdesktop.host.enabledpatch already existed in Systems. This change moves the state selection and the patch into one helper that Systems and the panel share, so policy and the authority check are not duplicated. The helper declares the narrow runtime-config shape it needs and imports nothing from the panel inputs, sodesktop-panel-inputs.tsimports that type from the helper in one direction only. Systems keeps its own copy, which sits under the selected machine's row; the panel uses its own English keys that name the Gateway host (the browser is often on another computer), plus the account and network lines shown before consent.desktop.host.enabled: truepatch as Systems, then re-read and connect; a rejected patch shows the config errorunsupportedHow the issue's Expected behavior maps to the rows above:
environments.listsetup check, state selection anddesktop.host.enabledpatch helper as Systems, inside the panelOpenClaw never turns on Screen Sharing itself or changes macOS permissions. The docs' Desktop section now mentions the chat panel path.
Evidence
All of the following ran on one machine (macOS, Apple silicon) at the staged tree, base
714a6da6196. The screenshots in Behaviour were captured one revision earlier; the only later change is the type import above (no emitted code), and the upgrade run below rendered the same text from the final tree.Build. The Control UI e2e harness builds the UI from each checkout and serves it with Vite preview; a real Gateway runs in process from the same checkout (synthetic state, loopback,
auth.mode: none, a fixture model so chat opens). BEFORE is this branch with only the production files reverted to the base (tests kept). Served bundles: BEFORE/assets/index-BeVLqI-e.js, AFTER/assets/index-BSUB8YgB.js.Behaviour. Local chat, Layout, Toggle desktop panel. Panel text read from the DOM (
innerText):No screen-sharing server (Gateway
desktop.hostwithenabled: falseand a port where nothing listens, so the setup check reportsneeds-server).BEFORE:
The requested desktop is unavailable. Retry when the machine is ready./RetryAFTER:
Desktop access is not enabled on the Gateway host. This panel shares the Gateway host's screen, not the screen of the device running this browser./Turn on Screen Sharing/On the Gateway host Mac, open System Settings → General → Sharing. Turn on Screen Sharing, or allow the Gateway host account to Observe and Control in Remote Management, then check again./Screen Sharing may also be reachable from other devices on your network./Check againScreen Sharing running, Host Desktop not enabled (no
desktopconfig). BEFORE shows the same generic notice and Retry. AFTER:Desktop access is not enabled on the Gateway host. This panel shares the Gateway host's screen, not the screen of the device running this browser./Screen Sharing is available/Enable desktop access to view and control the Gateway host in OpenClaw./Screen Sharing may also be reachable from other devices on your network./Screen Sharing signs in with a macOS user account on the Gateway host. A sign-in prompt follows after you enable access./Enable desktop access in OpenClaw/Applies without restarting the Gateway.Clicking Enable desktop access in OpenClaw on that Gateway: the browser sent
config.patchwithraw{"desktop":{"host":{"enabled":true}}}(responseok), thenenvironments.status {environmentId: "gateway"}returneddesktop: trueand the panel sentdesktop.observe {source: {kind: "host"}, control: false}. The Gateway config afterwards haddesktop.host.enabled: true, and the panel showed the macOS account prompt (Enter a macOS account allowed in System Settings → General → Sharing. ...). No credentials were entered.Upgrade and existing settings. Latest stable
[email protected](npmlatest) was installed in a temporary directory. Its own CLI wrote each config (openclaw config set --batch-file,meta.lastTouchedVersion: "2026.10.5") with a fulldesktop.hostblock using every key its schema accepts, and the stable Gateway booted on it ([gateway] http server listening (15 plugins: ...), then[shutdown] completed cleanly in 134ms). Then, on the same config and state, this tree's built CLI ranopenclaw doctor --fix --non-interactive(this tree refuses stable-era state until doctor migrates it, as for any upgrade; doctor leftdesktopuntouched) andopenclaw gateway run(loopback, token auth). The Control UI built from this tree connected to it. Paths are shown as<arm-A>/<arm-C>; the password file holds a synthetic value.enabled: false, as stable wrote it:{"enabled": false, "managed": false, "port": 5900, "passwordFile": "<arm-A>/vnc-password-synthetic"}.2026-10-19T19:06:03.721-07:00 [gateway] http server listening (20 plugins: acpx, anthropic, bonjour, browser, canvas, cua-computer, device-pair, file-transfer, geolocation, github, google-meet, linux-node, llama-cpp, memory-core, ollama, openai, talk-voice, teams-meetings, xai, zoom-meetings; 3.2s)environments.list {includeDesktopSetup: true}, gotdesktopSetup: {state: "ready"}, and showed the setup state:Desktop access is not enabled on the Gateway host. .../Screen Sharing is available/ ... /Enable desktop access in OpenClaw/Applies without restarting the Gateway.(same text as case 2).config.patchraw{"desktop":{"host":{"enabled":true}}}. Gateway log, whole records:diffof the whole 172-line config file before and after Enable:managed,portandpasswordFileare byte-identical; the panel then showed the macOS account prompt.enabled: true, as stable wrote it:{"enabled": true, "managed": false, "port": 5900, "passwordFile": "<arm-C>/vnc-password-synthetic"}. The Gateway booted the same way. The panel sent no setup check: its requests wereenvironments.status(desktop: true) and thendesktop.observe {source: {kind: "host"}, control: false}, the existing connect path, which reached the same account prompt (2026-10-19T19:09:11.840-07:00 [ws] ⇄ res ✗ desktop.observe 416ms errorCode=INVALID_REQUEST errorMessage=macOS account credentials are required to observe Screen Sharing bytes=255 conn=<conn-id> id=62:7bffe6b9-…fa1d). The config file's SHA-256 was the same before and after the run.Data-model compatibility: the change adds no stored fields and no migration. A
desktop.hostblock written by the latest stable release loads in this tree, is shown as-is, and keeps every key: the only write is the same one-keydesktop.host.enabledpatch Systems already makes.Tests (
pnpm test <paths>):ui/src/components/desktop/desktop-panel-host-setup.test.ts(new):Test Files 1 passed (1),Tests 6 passed (6). With--maxWorkers=1:Duration 2.00s, process wall timereal 3.90s. CI seconds will be added once CI has run.ui/src/components/desktop/+ui/src/pages/systems/:Test Files 16 passed (16),Tests 179 passed (179)chat-pane-embedded-panels,chat-pane-panel-toolbar,chat-pane-session-panel-toggle,chat-pane-sidebar-layout(.lazy),chat-pane-sidebar-view,chat-sidebar-region):Test Files 7 passed (7),Tests 79 passed (79)Regression proof. The new file with only the production change reverted:
Tests 4 failed | 2 passed (6). The four setup cases (enable then connect, Check again then connect, administrator hint on a Linux host, enable failure) fail on the generic notice, for exampleexpected '\nThe requested desktop is unavailabl…' to contain 'Screen Sharing is available'. The two guards pass on both sides by design: a node target keeps the generic notice and never asks for setup, and a failed setup check keeps the generic notice. With the change:6 passed (6).Other checks
pnpm check:madge-import-cyclesMadge import cycle check: 0 cycle(s).At the previous revision it failed with1 cycle(s):ui/src/components/desktop/desktop-panel-inputs.ts -> ui/src/components/desktop/host-desktop-setup.tspnpm tsgo:uioxfmt --check(changed files)oxlint(changed files)desktop-panel-solid.tsx:276, same on the basepnpm ui:i18n:verifygit diff --checkcheck:changed --base 714a6da6196chat-message.test.tsx,config-page-state.ts,sessions-page-state.ts), core tsgo graph boundary (gateway-root725 andplugins-platform724 roots over the advisory 720), dead-export scan (src/state/openclaw-state-db-historical-fixtures.test-support.ts, same three exports frompnpm deadcode:exportson the base)changed:lanesui,coreTests,docsGaps, stated plainly
needs-server) is the one the reporter's Gateway produces with nothing on 5900.unsupportedstates reuse the shared state selection and were not screenshotted.desktop.host.passwordFilewas preserved, but VNC password sign-in was not exercised: this Mac's Screen Sharing asks for a macOS account, so the existing connect path showed the account prompt in both arms.managedwasfalsebecause managed desktops are Linux-only. The upgrade run did not cover a Linux Gateway.