Skip to content

fix(ui): open the current session desktop directly - #122992

Merged
steipete merged 2 commits into
mainfrom
steipete/blissful-murdock-5fdc73
Aug 13, 2026
Merged

steipete merged 2 commits into
mainfrom
steipete/blissful-murdock-5fdc73

Conversation

@steipete

@steipete steipete commented Aug 13, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Fixes an issue where users opening Desktop from a chat session were shown the Gateway-wide Desktop sources picker and had to choose a second time, even though the session already has one authoritative execution environment.

Why This Change Was Made

The chat header now resolves the current session directly to its Gateway host, cloud-worker environment, or execution node and passes that target to the Desktop panel. Direct activation refreshes the environment inventory before observing so worker app metadata remains available, while unresolved remote placements never fall back to another machine. The command-palette Desktop action remains the explicit global source picker.

User Impact

Clicking Desktop inside a local, cloud, or node-hosted session now opens that session's desktop immediately. Users no longer need to select This machine or another already-known source a second time.

Evidence

  • Regression proof before the fix: the local-session header emitted only { open: true } instead of targeting gateway.

  • node scripts/run-vitest.mjs ui/src/pages/chat/chat-pane-terminal.test.ts — 9 passed.

  • node scripts/run-vitest.mjs run --config test/vitest/vitest.ui-e2e.config.ts --configLoader runner ui/src/e2e/desktop-panel.e2e.test.ts — 12 passed.

  • node scripts/check-changed.mjs -- <seven changed UI paths> — passed after remote Testbox was unavailable and the repository wrapper fell back to local execution.

  • Fresh Codex autoreview — clean, no accepted/actionable findings.

  • Production LOC: +113/-49 (net +64); tests: +270/-22.

  • Before (current Team production): clicking Desktop opens the Gateway-wide source picker and requires a second Connect action.

    Before: session Desktop opens the source picker

  • After, live on Team at the first PR head 84a63af11ea0ed2fe791fa4b219a83e6b2505609: one Desktop click goes directly through Connecting to desktop… to the real XFCE/RFB canvas. No source picker or second Connect action appears. Final head dad46ead768712c99ff7341f47ff6af2b225c7e4 adds only the review-requested retry state for inventory failures; the successful routing path shown here is unchanged.

session-desktop-live-proof.mp4

After: session Desktop is connected directly

  • Live deployment proof: cold build with cache disabled, non-interactive Doctor, /healthz 200, /readyz 200, exact deployed source SHA verified before recording. Team was then restored to current main with auto-update enabled.
  • Review recovery proof on final head: the inventory-failure E2E now shows Retry, performs a second environments.list, observes the same retained worker target, and never exposes the source picker.

AI-assisted change; implementation and behavior were independently reviewed and verified against the owning UI and Gateway boundaries.

@clawsweeper

clawsweeper Bot commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

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

@openclaw-barnacle openclaw-barnacle Bot added app: web-ui App: web-ui size: M maintainer Maintainer-authored PR labels Aug 13, 2026
@clawsweeper clawsweeper Bot added merge-risk: 🚨 other 🚨 Merging this PR has meaningful risk outside the owned taxonomy. P2 Normal backlog priority with limited blast radius. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Aug 13, 2026
@clawsweeper

clawsweeper Bot commented Aug 13, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed August 13, 2026, 2:14 AM ET / 06:14 UTC.

ClawSweeper review

What this changes

The PR makes a chat session’s Desktop action connect directly to its resolved host, worker, or node desktop, with retry when fresh environment inventory loading fails.

Merge readiness

⚠️ Ready for maintainer review - 2 items remain

Keep open. Current main still opens the generic Desktop picker, while the final branch routes through the session’s authoritative target and resolves the prior retry blocker; no blocking correctness finding remains. The maintainer-owned PR should proceed through normal exact-head CI and ownership review.

Priority: P2
Reviewed head: dad46ead768712c99ff7341f47ff6af2b225c7e4

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) Strong real UI proof and focused boundary coverage support a correct fix; the only remaining concern is whether the added production structure is necessary.
Proof confidence 🦞 diamond lobster (5/6) ✨ media proof bonus Sufficient (recording): The PR includes a redacted live before/after desktop recording for the central direct-connect behavior and final-head E2E evidence for the inventory-failure Retry path.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (recording): The PR includes a redacted live before/after desktop recording for the central direct-connect behavior and final-head E2E evidence for the inventory-failure Retry path.
Evidence reviewed 7 items Current-main behavior: Current main emits a targetless Desktop-open event from the chat header, which takes the panel’s generic picker path rather than selecting the current session’s environment.
Direct target owner: The branch resolves cloud placement to its environment ID, node execution to a node source ID, and local execution to the Gateway target; unresolved cloud placement returns no Desktop action.
Recovery fix: The final commit refreshes inventory before direct observation, enters a recoverable inventory-error state on failure, and retries the retained target instead of exposing another source picker.
Findings None None.
Security None None.

How this fits together

A chat session exposes placement data that identifies its execution environment. The Control UI converts that placement into a desktop source, refreshes desktop metadata, and asks the Gateway to observe the exact source; the command palette remains the global source picker.

flowchart LR
  A[Chat session] --> B[Placement resolution]
  B --> C[Desktop target]
  C --> D[Desktop panel]
  D --> E[Refresh environment inventory]
  E --> F[Observe exact desktop]
  F --> G[Remote desktop canvas]
  D --> H[Retry after inventory failure]
Loading

Before merge

  • Resolve merge risk (P1) - Production code grows by 64 net lines for this bug fix; maintainers should confirm the one-use recovery-rendering module is worth its added surface before merge.
  • Complete next step (P2) - This maintainer-owned PR has a resolved prior finding and needs normal exact-head CI and ownership handling, not a separate repair job.
Agent review details

Security

None.

PR surface

Source +64, Tests +248. Total +312 across 7 files.

View PR surface stats
Area Files Added Removed Net
Source 5 113 49 +64
Tests 2 270 22 +248
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 7 383 71 +312

Review metrics

Metric Value Why it matters
Production versus test LOC production +113/-49 (net +64); tests +270/-22 (net +248) The added behavior and regression coverage are substantial for a UI bug fix, so the positive production surface merits an explicit simplification check.

Merge-risk options

Maintainer options:

  1. Decide the mitigation before merge
    Keep one authoritative session-to-desktop route with fresh inventory and retained-target retry; inline the one-use recovery template into the desktop panel if it does not earn reuse.
  2. Pause or close
    Do not merge this PR until maintainers decide whether the risk is worth taking.

Technical review

Best possible solution:

Keep one authoritative session-to-desktop route with fresh inventory and retained-target retry; inline the one-use recovery template into the desktop panel if it does not earn reuse.

Do we have a high-confidence way to reproduce the issue?

Yes. Current main emits a targetless session Desktop event and enters the global-picker path; the final-head E2E exercises the direct target and retry sequence, though this read-only review did not execute it.

Is this the best way to solve the issue?

Yes. Placement is the authoritative owner of the destination, the existing Gateway protocol validates that destination, and fresh inventory preserves worker desktop metadata before connection.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 7620a58b2955.

Labels

Label changes:

  • add proof: sufficient: Contributor real behavior proof is sufficient. The PR includes a redacted live before/after desktop recording for the central direct-connect behavior and final-head E2E evidence for the inventory-failure Retry path.
  • add proof: 🎥 video: Contributor real behavior proof includes video or recording evidence. The PR includes a redacted live before/after desktop recording for the central direct-connect behavior and final-head E2E evidence for the inventory-failure Retry path.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🦞 diamond lobster and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (recording): The PR includes a redacted live before/after desktop recording for the central direct-connect behavior and final-head E2E evidence for the inventory-failure Retry path.
  • remove rating: 🦪 silver shellfish: Current PR rating is rating: 🐚 platinum hermit, so this older rating label is no longer current.
  • remove status: ⏳ waiting on author: Current PR status label is status: 👀 ready for maintainer look.
  • remove merge-risk: 🚨 other: Current PR review selected no merge-risk labels.

Label justifications:

  • P2: This repairs a bounded but user-visible Control UI workflow that currently requires an unnecessary second selection.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🦞 diamond lobster and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (recording): The PR includes a redacted live before/after desktop recording for the central direct-connect behavior and final-head E2E evidence for the inventory-failure Retry path.
  • proof: sufficient: Contributor real behavior proof is sufficient. The PR includes a redacted live before/after desktop recording for the central direct-connect behavior and final-head E2E evidence for the inventory-failure Retry path.
  • proof: 🎥 video: Contributor real behavior proof includes video or recording evidence. The PR includes a redacted live before/after desktop recording for the central direct-connect behavior and final-head E2E evidence for the inventory-failure Retry path.

Evidence

What I checked:

Likely related people:

  • steipete: Current-main blame attributes the existing chat-placement and desktop-panel paths to Peter Steinberger, and the branch commits introduce the direct-target and retry behavior. (role: recent area contributor; confidence: high; commits: 5db09954c76b, 84a63af11ea0, dad46ead7687; files: ui/src/pages/chat/chat-pane-placement.ts, ui/src/components/desktop/desktop-panel.ts)

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Confirm that the one-use recovery renderer should remain extracted rather than be folded into the existing desktop panel.

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-08-13T05:20:20.937Z sha 84a63af :: needs changes before merge. :: [P2] Restore recovery after direct inventory failure

@steipete
steipete marked this pull request as ready for review August 13, 2026 05:38
@steipete steipete closed this Aug 13, 2026
@steipete steipete reopened this Aug 13, 2026
@clawsweeper clawsweeper Bot added proof: 🎥 video Contributor real behavior proof includes video or recording evidence. proof: sufficient ClawSweeper judged the real behavior proof convincing. 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. and removed rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. merge-risk: 🚨 other 🚨 Merging this PR has meaningful risk outside the owned taxonomy. labels Aug 13, 2026
@steipete

Copy link
Copy Markdown
Contributor Author

Land-ready proof for final head dad46ead768712c99ff7341f47ff6af2b225c7e4:

  • Focused UI unit: node scripts/run-vitest.mjs ui/src/pages/chat/chat-pane-terminal.test.ts — 9 passed.
  • Browser E2E: node scripts/run-vitest.mjs run --config test/vitest/vitest.ui-e2e.config.ts --configLoader runner ui/src/e2e/desktop-panel.e2e.test.ts — 12 passed, including retained-target Retry after an inventory failure.
  • Changed gate: node scripts/check-changed.mjs -- <seven changed UI paths> — passed. The remote backend was unavailable, so the repository wrapper performed its documented local fallback; typechecks, lint, max-lines, dead exports, formatting, and shared guards passed.
  • Fresh Codex autoreview — clean, no accepted/actionable findings.
  • Exact-head CI: https://github.com/openclaw/openclaw/actions/runs/31672717708 — green.
  • Live Team proof is embedded in the PR body: sanitized before screenshot plus a real one-click session Desktop video through the connected XFCE/RFB canvas. Team was restored to current main, health/readiness 200, and auto-update enabled after recording.
  • Latest ClawSweeper review has no findings and marks proof sufficient. I am keeping desktop-panel-state.ts: it owns the closed recovery-state vocabulary and the shared Retry/Reconnect presentation for two distinct panel failures while keeping the already-full desktop panel below the 700-line gate.

Known proof gap: the live success video was recorded on the first PR head; the final commit changes only inventory-failure recovery. The final-head E2E covers that exact Retry behavior and the successful routing path is unchanged.

@steipete
steipete merged commit 2464c17 into main Aug 13, 2026
105 checks passed
@steipete
steipete deleted the steipete/blissful-murdock-5fdc73 branch August 13, 2026 06:24
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

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 maintainer Maintainer-authored PR P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. proof: 🎥 video Contributor real behavior proof includes video or recording evidence. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: M 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