Skip to content

fix(test): wait for desktop viewer handoff before resizing - #149975

Merged
steipete merged 1 commit into
mainfrom
upd/flake-desktop-resize-handoff-wait
Sep 16, 2026
Merged

steipete merged 1 commit into
mainfrom
upd/flake-desktop-resize-handoff-wait

Conversation

@steipete

Copy link
Copy Markdown
Contributor

Related: #143817, #149919, #148354

What Problem This Solves

Fixes intermittent desktop resize CI failures when the resize matrix starts before the former controller's replacement viewer has received its first frame.

User Impact

No product behavior changes. This stabilizes the existing real-Gateway desktop resize test for both SSH and node transports while preserving its framebuffer, input-filtering, and controller-ownership assertions.

Why This Change Was Made

Extract the self-contained readiness wait from #143817 at 6a443c9edf23d85652a9432f5a79a29a086865df. After control changes hands, wait for the former controller's canvas to detach, then assert the replacement framebuffer's dimensions and rendered pixels before enabling Match and resizing. Reuse the test's existing pixel sampler. No feature or viewer-lifecycle changes, sleeps, retries, timeout increases, or weakened assertions are included.

Evidence

Hosted failure: run 35077445638, job 104733359756. The missing-canvas failure also recurred on later merge-refs of #149919. The preserved artifact shows the replacement viewer connecting and then closing upstream, leaving zero canvases instead of the expected 900×500 framebuffer. The SSH tunnel-exit evidence was empty; the terminal endpoint event was upstream closure.

Source hunk in #143817. Only this wait and its small, local pixel-sampling extraction were ported.

Local proof used a task-owned Debian Docker fixture with the built Gateway, isolated OpenClaw state, free Gateway ports, real TigerVNC, and Chromium. The tested file exactly matched the committed candidate.

Proof Result
Full file, node transport Passed: 1 test, no failures or skips
Full file, SSH transport Passed: 1 test, no failures or skips
Bounded SSH loop, iterations 1–6 6/6 passed, including resize assertions and cleanup
SSH iteration 7 Resize and ownership assertions passed; cleanup failed
SSH iteration 8 Not run after the fail-fast loop stopped

Iteration 7 retained the completed resize proof: 390×900 and 900×500 framebuffers, 271 sampled colors, and zero observer input/resize bytes forwarded. Its failure was AggregateError: Desktop resize proof cleanup failed. Follow-up: nested cleanup error not preserved by the harness; separate evidence gap, in the evidence-preservation area addressed by #148354. The final container inspection did not identify the nested cleanup error; proxy EPIPE messages do not establish which cleanup operation failed. No tests were rerun around this failure, and the owned proof containers have been removed. Hosted CI remains the authority for this lane.

node scripts/check-changed.mjs passed before and after committing. git diff --check passed. P1 autoreview of the committed branch (--mode branch --base origin/main) was scoped-clean with no actionable findings.

Production LOC: unchanged. Test LOC: +25 / −11 in one file.

Port the self-contained handoff readiness wait from #143817. Wait for the former controller canvas to detach and for its replacement to render before starting the resize matrix on both transports.
@clawsweeper

clawsweeper Bot commented Sep 16, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

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

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@steipete
steipete marked this pull request as ready for review September 16, 2026 10:20
@openclaw-barnacle openclaw-barnacle Bot added app: web-ui App: web-ui size: XS maintainer Maintainer-authored PR labels Sep 16, 2026
@clawsweeper clawsweeper Bot added P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. 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. labels Sep 16, 2026
@clawsweeper

clawsweeper Bot commented Sep 16, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed September 16, 2026, 6:26 AM ET / 10:26 UTC.

ClawSweeper review

What this changes

The desktop resize test waits for the former controller’s replacement viewer to render before resizing, reusing its existing pixel sampler.

Merge readiness

✅ Ready for maintainer review

This remains a useful, focused test repair: current main lacks the readiness wait, and no introduced correctness or security defect was found. The related merged diagnostics work does not fix this ordering gap.

Priority: P3
Reviewed head: 2e3b2c2f9f3091e375a13e40c176e1f3e9742691

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused readiness repair with relevant real-path results and no actionable introduced defect.
Proof confidence 🐚 platinum hermit (4/6) Sufficient (live_output): Reported candidate-matching runs exercise the existing desktop viewer through a built Gateway, real TigerVNC, and Chromium on both transports, with successful resize and ownership results. The seventh SSH iteration’s cleanup failure remains separately disclosed rather than counted as a full pass.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (live_output): Reported candidate-matching runs exercise the existing desktop viewer through a built Gateway, real TigerVNC, and Chromium on both transports, with successful resize and ownership results. The seventh SSH iteration’s cleanup failure remains separately disclosed rather than counted as a full pass.
Evidence reviewed 6 items Verified introduced change: The merge-base-to-head diff adds readiness assertions and extracts the existing pixel sampler. Geometry, input filtering, cleanup, and timeout expectations remain unchanged.
Production handoff contract: A control-taken disconnect starts a replacement view-only connection; connection preparation changes controller state before rendering finishes. Existing tests and desktop documentation independently describe this reconnect behavior.
Current main still lacks the wait: Fetched main proceeds from control-option assertions directly to Match and the resize matrix, without awaiting replacement pixels.
Findings None None.
Security None None.

How this fits together

The Control UI desktop viewer connects through the Gateway to a remote desktop. This end-to-end test exercises controller handoff, display resizing, and read-only input filtering over node and SSH transports.

flowchart LR
  A[Real desktop fixture] --> B[Gateway transport]
  B --> C[Two browser viewers]
  C --> D[Control handoff]
  D --> E[Replacement viewer renders]
  E --> F[Resize and ownership assertions]
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Tests +14. Total +14 across 1 file.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 1 25 11 +14
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 1 25 11 +14

Review metrics

None.

Technical review

Best possible solution:

Keep readiness synchronization in the existing end-to-end test while preserving its real transport, framebuffer, and ownership checks.

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

No deterministic reproduction was established in this review. The reported hosted failure and inspected lifecycle support the ordering gap, but do not independently prove the precise upstream disconnect mechanism.

Is this the best way to solve the issue?

Yes. Waiting for the replacement canvas and rendered pixels directly synchronizes the existing scenario without weakening assertions or changing runtime behavior.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 2ef2537cd039.

Labels

Label changes:

  • add P3: This is a bounded test-stability repair with no production behavior change.
  • add proof: sufficient: Contributor real behavior proof is sufficient. Reported candidate-matching runs exercise the existing desktop viewer through a built Gateway, real TigerVNC, and Chromium on both transports, with successful resize and ownership results. The seventh SSH iteration’s cleanup failure remains separately disclosed rather than counted as a full pass.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (live_output): Reported candidate-matching runs exercise the existing desktop viewer through a built Gateway, real TigerVNC, and Chromium on both transports, with successful resize and ownership results. The seventh SSH iteration’s cleanup failure remains separately disclosed rather than counted as a full pass.

Label justifications:

  • P3: This is a bounded test-stability repair with no production behavior change.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (live_output): Reported candidate-matching runs exercise the existing desktop viewer through a built Gateway, real TigerVNC, and Chromium on both transports, with successful resize and ownership results. The seventh SSH iteration’s cleanup failure remains separately disclosed rather than counted as a full pass.
  • proof: sufficient: Contributor real behavior proof is sufficient. Reported candidate-matching runs exercise the existing desktop viewer through a built Gateway, real TigerVNC, and Chromium on both transports, with successful resize and ownership results. The seventh SSH iteration’s cleanup failure remains separately disclosed rather than counted as a full pass.

Evidence

What I checked:

Likely related people:

  • vincentkoc: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • steipete: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

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.

@steipete
steipete merged commit cecf887 into main Sep 16, 2026
133 checks passed
@steipete
steipete deleted the upd/flake-desktop-resize-handoff-wait branch September 16, 2026 10:47
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 17, 2026
…enclaw#149975)

Port the self-contained handoff readiness wait from openclaw#143817. Wait for the former controller canvas to detach and for its replacement to render before starting the resize matrix on both transports.
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 P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: XS 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