Repository navigation
fix(ui): open the current session desktop directly - #122992
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: needs maintainer review before merge. Reviewed August 13, 2026, 2:14 AM ET / 06:14 UTC. ClawSweeper reviewWhat this changesThe 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 readinessKeep 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 Review scores
Verification
How this fits togetherA 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]
Before merge
Agent review detailsSecurityNone. PR surfaceSource +64, Tests +248. Total +312 across 7 files. View PR surface stats
Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest 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. LabelsLabel changes:
Label justifications:
EvidenceWhat 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
HistoryReview history (1 earlier review cycle)
|
|
Land-ready proof for final head
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. |
|
Merged via squash.
|
* fix(ui): open session desktop directly * fix(ui): make session desktop retryable
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 targetinggateway.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.
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 headdad46ead768712c99ff7341f47ff6af2b225c7e4adds only the review-requested retry state for inventory failures; the successful routing path shown here is unchanged.session-desktop-live-proof.mp4
/healthz200,/readyz200, exact deployed source SHA verified before recording. Team was then restored to currentmainwith auto-update enabled.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.