Repository navigation
fix(ui): retain desktop viewer through control handoff - #134903
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
eb378be to
261df68
Compare
|
Codex review: needs maintainer review before merge. Reviewed September 1, 2026, 11:57 AM ET / 15:57 UTC. ClawSweeper reviewWhat this changesThe PR retains a disabled same-source desktop viewer until the replacement RFB viewer connects, so switching between view-only and control does not tear down the only authenticated session. Merge readinessKeep this maintainer-authored, maintainer-labelled PR open for explicit owner handling. The exact head has no blocking correctness finding: it moves the overlapping-viewer state into the desktop connection owner and the previous CI rank-up is resolved by a successful current-head CI gate. Priority: P1 Review scores
Verification
How this fits togetherControl UI asks the Gateway for a desktop observation endpoint, then DesktopClient creates the browser’s noVNC/RFB viewer. The desktop panel owns presentation state and now coordinates the old and replacement viewers during a control handoff. flowchart LR
A[Desktop control toggle] --> B[Gateway desktop observation]
B --> C[Desktop panel handoff owner]
C --> D[Retained view-only viewer]
C --> E[Replacement RFB viewer]
E --> F[Authenticated connection event]
F --> G[Old viewer retired]
C --> H[Desktop panel state]
Decision needed
Why: The PR is authored by a repository member and carries the protected maintainer label, so this workflow must leave the final landing decision to explicit maintainer handling. Before merge
Agent review detailsSecurityNone. PR surfaceSource +52, Tests +284. Total +336 across 10 files. View PR surface stats
Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Land the bounded same-source handoff after explicit desktop-owner sign-off, retaining one input-disabled predecessor only until the replacement RFB connection reports ready. Do we have a high-confidence way to reproduce the issue? Yes, source-reproducible: the new production-client E2E models the last-viewer teardown and asserts the required authenticated-old → authenticated-replacement → old-closed order, which the former eager disconnect could not preserve. Is this the best way to solve the issue? Yes. The handoff state belongs in the desktop connection owner, rather than in Gateway observation or a downstream UI guard; it also disables the retained viewer immediately and clears it on each failure path. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 60c5793325d0. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (1 earlier review cycle)
|
|
Verification for source commit Focused commands passed:
Fresh managed Codex review of the complete candidate found no actionable findings. Live Windows/TightVNC before/after, control input, view-only input blocking, repeated transitions, cancellation/reconnect and one/zero steady/closed peer counts are documented in the body, including sanitized images. The fullscreen CI failure is preserved and repaired by waiting for original-canvas retirement at replacement authentication. Current main supplies the separate release-inventory fix; the Code Mode fixture resumes its same bounded run. No macOS GUI claim is made by this PR. Installed noVNC1.7 source was directly checked for input disablement, its ServerInit-to-connect event and per-client screen cleanup. Required CI: run 33526986212. The latest ClawSweeper review has no source finding; its rank-up request is to resolve the required exact-head gate. The canonical exact-head watcher completed GREEN with zero pending checks. Native review artifacts validate and the required CI gate passed. Proceeding through repository-native preparation and merge; no rule bypass. |
|
Merged via squash.
|
* fix(ui): retain desktop viewer through control handoff * docs: leave desktop release notes to release generation * test: resume Code Mode lifecycle through waiting results * test(ui): await authenticated fullscreen handoff
Switching a Windows desktop from view-only to control could close the only authenticated VNC viewer before its replacement authenticated. On the real TightVNC 2.8.85 host this disconnected the replacement twice; retaining a second authenticated viewer made the same transition succeed.
The existing desktop connection owner now retains at most one same-source viewer, disables its input immediately, and retires it when noVNC reports an authenticated connection. Observe RPC completion and a returned client handle are not that boundary. Failure, credential prompting, source changes, hidden panels and unmount release both connections. A canceled lazy noVNC load also checks the existing operation identity before opening a control WebSocket.
This replaces the nullable-handle lifecycle; Gateway authentication, controller arbitration, observer caps and view-only filtering are unchanged. There are no new dependencies, configuration, timeouts, retries or compatibility paths. Production delta is +79/-27 (net +52): bounded overlapping connection ownership and explicit input/readiness transfer require state that the old single-handle owner could not express. Duplicate environment lookup was removed. Desktop tests/support are +304/-19; the Code Mode CI fixture follow-up is +5/-6. Release-note context stays here; the release-owned root changelog has no PR delta.
Validation:
The TightVNC source supports a last-client teardown race: it clears/deletes the old desktop while a replacement can be authenticating, and an old IPC close can disconnect clients. The internal callback race was not instrumented; the live failure/control comparison and real-noVNC ordering regression are the direct repair evidence. macOS ARD authentication remains Gateway-owned; this is not a claim of live macOS GUI proof.
Before (sole-viewer Take control):
After (same panel remains connected):
CI follow-up and integration:
The first CI run exposed an existing release-plan inventory overflow: the full Git tree exceeded Node’s default 1 MiB output buffer. Main already landed the canonical metadata-only enumeration repair in perf(ci): shorten release verification tails #134824; this PR integrates that main revision rather than carrying a second fix. Its large-tree, four symlink, and current publisher-inventory regressions passed (6 tests).
An existing Code Mode lifecycle fixture assumed one wait must be terminal despite the runtime’s per-call budget. It now uses the existing bounded helper to resume the same run; the two executions, exactly-once lifecycle and cleanup assertions are unchanged. No runtime budget, timeout, action replay or production behavior changed. Fresh managed Codex P0 review and canonical changed-file checks passed.
Both complete agent files passed (30 tests), including the unchanged acquired/borrowed/empty transport table. The prior acquired-transport timeout in the 85-file CI shard remains unexplained; the focused pass does not replace that original evidence. The prior integration run is 33480747319; its fullscreen handoff timing failure is repaired below.
The integrated CI run exposed one additional fullscreen test race: it queried a strict single canvas after the observation RPC acknowledged, while the intended authenticated handoff still held both canvases. The existing test now waits for retirement of the original canvas (owned by replacement noVNC connect) before its single visible-canvas assertion. Fullscreen identity, geometry and control assertions remain. All three complete Desktop E2E files passed again (35 tests), and canonical changed-file checks passed. Production bytes are unchanged.
Fresh managed Codex review of the complete candidate found no actionable findings. The final test repair is commit
e5af1515ecb4782403b95ac9cfc5d105c3303c5b; GitHub branch state confirms it is pushed. Exact-head PR checks remain required before native landing.