Skip to content

test(ui): fix stale toast and racing handoff browser tests - #204004

Merged
obviyus merged 1 commit into
mainfrom
fix/ui-browser-flake
Nov 23, 2026
Merged

obviyus merged 1 commit into
mainfrom
fix/ui-browser-flake

Conversation

@obviyus

@obviyus obviyus commented Nov 23, 2026 •

Copy link
Copy Markdown
Collaborator

checks-ui (1/3) and checks-ui (3/3) pass again on unrelated PRs. Two Control UI browser tests failed for reasons not caused by the PRs that ran them: one was stale against a change on main, one raced the code that owns the menu height.

Fixes #203988

Cause

  1. ui/src/lib/toast.browser.test.ts (shard 1/3): stale test, fails every time on main.
  2. ui/src/pages/chat/components/chat-attachment-handoff.browser.test.tsx "resizing" (shard 3/3): timing race in the test. This test was added in improve: make common Chat controls quicker to open #203669 (merged 04:35 UTC).
    • The test set surface.style.height itself with a 10 s transition. ChatComposerPlusMenuFrame owns that height and measures it one layout frame after the menu opens.
    • On a loaded runner, that measurement comes after the test's write and puts the old height back. The browser then cancels the running transition (transitioncancel height was recorded), so no animation is running at pointerdown. All 21 failing shard-3 logs fail at line 62, expect(animatingAtPointerDown).toBe(true).
  3. board-view.browser.test.ts never failed. A triage script matched the × in its test name "480×634". All 73 failed-job logs show this file passing.

Fix

  • Toast test: expect [["live"]]. This is the current listener contract, the same value its sibling test in native-overlay-occlusion.test.ts expects.
  • Handoff test, "resizing" case: the menu grows the way it does in the product, when capabilities arrive while the menu is open.
    • The test waits until the menu frame has written its height in pixels, then adds a root toggle.
    • The frame writes the new height, and the panel's own [data-phase="open"] height transition runs. The test only makes that transition 10 s long.
    • The test loads styles/chat/composer.css so the real transition rule applies, and polls for the running animation instead of asserting it once.
  • No product code changes.

Evidence

main b917ed7 this PR
Toast test, local fails 1/1 (same assertion as CI) passes
Handoff "resizing", local, idle 15/15 pass passes
Handoff "resizing", local, CDP CPU throttle ×20 fails 6/6 (same assertion as CI) 30/30 pass
Handoff "resizing" with the product's transition-property suppression removed fails (activations 0, expected 1), so the test still guards the product

CI failure rate per shard, from PR runs of ci.yml:

before 05:00 UTC 2026-11-23 05:00–07:52 UTC (41 runs) this PR
checks-ui (1/3) 9/86 39/41 (95%) 0/3
checks-ui (3/3) 2/87 22/41 (54%) 0/7

Rerun proof on head 8148681, run 45138279133 (initial run plus gh run rerun --job attempts 2-9): checks-ui (3/3) passed 7 of 7 times and checks-ui (1/3) 3 of 3 times. At the old rates, the chance of these passes would be 0.46^7 ≈ 0.5% for shard 3 and 0.05^3 ≈ 0.01% for shard 1.

Why main did not stop it

Hourly main CI runs checks-ui, and it went red on the first hourly run after the merge (05:29 UTC, run 45118053016), then again at 06:45 and 07:29. Ordinary main pushes run only security-fast by design (OPENCLAW_CI_ON_PUSH). checks-ui was selected on both source PRs by its path rules. So the defect was detected on main within an hour; the red hourly run had no follow-up action. This PR changes no workflow file.

Rerun proof (distinct executions, head 8148681)

Run 45138279133 had 9 attempts. Each gh run rerun --job attempt re-ran only the selected shard, and the other shard's result was carried over. Distinct executions, by job start time:

Shard Passed / executions Old failure rate (41 PR runs since 05:00Z) Chance of this result by luck at the old rate
checks-ui (1/3) 3/3 95% 0.05^3 ≈ 0.01%
checks-ui (3/3) 7/7 54% 0.46^7 ≈ 0.5%

No execution failed.

- Expect the current "live" occlusion state in the native-tab toast test.
- Grow the composer menu through its height owner instead of writing the
  owned panel height from the test.

Fixes #203988

Co-authored-by: obviyus <[email protected]>
@clawsweeper

clawsweeper Bot commented Nov 23, 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.

@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. P2 Normal backlog priority with limited blast radius. 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 clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Nov 23, 2026
@clawsweeper

clawsweeper Bot commented Nov 23, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

This PR updates the toast expectation and makes the attachment resize test grow the menu through its existing height owner.

Example: The browser test selects File while the composer menu grows after Web search becomes available.

  • Before: The test overwrites the panel height, which the menu frame can replace, cancelling the animation before pointerdown.
  • After: The test adds a Web search toggle, waits for the resulting animation, and verifies that File activates once after the popover closes.

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused, source-supported test repair with passing reviewed-head browser checks and no identified defect; shipped-product proof is unnecessary for this scope.
Proof confidence 🐚 platinum hermit (4/6) This test-only repair requires no shipped-entry-point demonstration; reviewed-head browser CI supports the changed fixtures, and the body reports baseline failures plus a negative control preserving the attachment regression.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Test only · Worth it: Yes · Fix scope: Complete
User problem: Contributors encounter failing Control UI checks on unrelated PRs and must investigate inherited failures.
Reason: The repair restores useful validation while retaining coverage of toast visibility and attachment activation; its maintainer-authored direction requires no further product decision.

Merge readiness

✅ Ready for maintainer review

Keep open: this focused test repair addresses confirmed inherited browser failures while preserving the product assertions; no actionable defects were found.

Priority: P2
Reviewed head: 81486815c2c7f8ce3ccd445316953916f120c19b

Before merge

None.

Findings

None.

Agent review details

How this fits together

Control UI browser tests exercise toast occlusion and composer attachment activation using real DOM layout, menu components, and CSS transitions.

flowchart TD
  A[Browser test] --> B[Composer menu props]
  B --> C[Menu content]
  C --> D[Menu frame measurement]
  D --> E[CSS height transition]
  E --> F[File selection]
  F --> G[Retained attachment input]
Loading

Technical review

Best possible solution:

Retain this focused repair so browser checks follow the established occlusion contract and exercise resizing through the existing menu frame.

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

The toast mismatch is deterministic from current source and matches CI annotations; the attachment failure trace matches the test's competing height write, with CPU-throttled reproduction reported by the author.

Is this the best way to solve the issue?

The patch uses the existing height owner, loads the real transition stylesheet, and preserves the original behavioral assertions without changing production code.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 84cab039664a.

Provenance checked

  • Toast occlusion expectation keeps the original intent (d2915cd: The test protects toast cutouts and action handling without suspending the native tab; the occlusion owner had already adopted string states in fix: keep Mac Browser tabs visible behind the command palette #203661.)
  • Attachment resize fixture keeps the original intent (577af7b: The regression protects synchronous picker activation while a menu resizes; the replacement fixture preserves that scenario while letting the frame own its measured height.)

Testing

Proof path: in-process harness.

Security

None.

Evidence

What I checked:

Likely related people:

  • Vyctor H. Brzezowski: Raw commit 98561a5 adds ui/src/lib/toast.browser.test.ts:177 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 98561a57a6e2; files: ui/src/lib/toast.browser.test.ts)
  • Peter Steinberger: Raw commit aff6771 adds ui/src/lib/toast.browser.test.ts:49 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: aff677109f8d; files: ui/src/lib/toast.browser.test.ts)

PR surface

Tests +13. Total +13 across 2 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 2 21 8 +13
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 2 21 8 +13

Preflight source

Source unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified.

Labels

Label changes:

  • add P2: Inherited browser-test failures disrupt unrelated PR validation without an established user-facing runtime outage.
  • 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.

Label justifications:

  • P2: Inherited browser-test failures disrupt unrelated PR validation without an established user-facing runtime outage.
  • 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.

Rating scale

6/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.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only. Repair and merge execution lanes are retired.

Reviewed November 23, 2026, 3:38 AM ET / 08:38 UTC.

@obviyus
obviyus merged commit 8d69930 into main Nov 23, 2026
495 checks passed
@obviyus
obviyus deleted the fix/ui-browser-flake branch November 23, 2026 09:37
@obviyus

obviyus commented Nov 23, 2026

Copy link
Copy Markdown
Collaborator Author

Landed in 8d69930. The toast test now expects the current "live" occlusion state, and the handoff resize test grows the menu through its height owner. checks-ui (3/3) passed 7 of 7 and (1/3) 3 of 3 runs on this head.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Nov 24, 2026
…204004)

`checks-ui (1/3)` and `checks-ui (3/3)` pass again on unrelated PRs. Two Control UI browser tests failed for reasons not caused by the PRs that ran them: one was stale against a change on `main`, one raced the code that owns the menu height.

Fixes openclaw#203988

## Cause

1. **`ui/src/lib/toast.browser.test.ts` (shard 1/3): stale test, fails every time on `main`.**
   - openclaw#203661 (merged 01:08 UTC, 6b2749c) changed `subscribeNativeOverlayOcclusion` listeners from `boolean` to `"live" | "hidden" | "backdrop" | "hidden-backdrop"` and updated the tests that existed then.
   - openclaw#203675 (merged 04:30 UTC, 9868d85) added a test that expects `[[false]]`. Its last CI run was at 21:09 UTC on 2026-11-22, before openclaw#203661 merged, so its own run did not include the new listener type.
   - Every merge ref that contains both commits fails with `expected [ [ 'live' ] ] to deeply equal [ [ false ] ]`. That is the error in all 40 failing shard-1 logs.
2. **`ui/src/pages/chat/components/chat-attachment-handoff.browser.test.tsx` "resizing" (shard 3/3): timing race in the test.** This test was added in openclaw#203669 (merged 04:35 UTC).
   - The test set `surface.style.height` itself with a 10 s transition. `ChatComposerPlusMenuFrame` owns that height and measures it one layout frame after the menu opens.
   - On a loaded runner, that measurement comes after the test's write and puts the old height back. The browser then cancels the running transition (`transitioncancel height` was recorded), so no animation is running at `pointerdown`. All 21 failing shard-3 logs fail at line 62, `expect(animatingAtPointerDown).toBe(true)`.
3. `board-view.browser.test.ts` never failed. A triage script matched the `×` in its test name "480×634". All 73 failed-job logs show this file passing.

## Fix

- Toast test: expect `[["live"]]`. This is the current listener contract, the same value its sibling test in `native-overlay-occlusion.test.ts` expects.
- Handoff test, "resizing" case: the menu grows the way it does in the product, when capabilities arrive while the menu is open.
  - The test waits until the menu frame has written its height in pixels, then adds a root toggle.
  - The frame writes the new height, and the panel's own `[data-phase="open"]` height transition runs. The test only makes that transition 10 s long.
  - The test loads `styles/chat/composer.css` so the real transition rule applies, and polls for the running animation instead of asserting it once.
- No product code changes.

## Evidence

| | `main` 6cc2ee8 | this PR |
|---|---|---|
| Toast test, local | fails 1/1 (same assertion as CI) | passes |
| Handoff "resizing", local, idle | 15/15 pass | passes |
| Handoff "resizing", local, CDP CPU throttle ×20 | fails 6/6 (same assertion as CI) | 30/30 pass |
| Handoff "resizing" with the product's `transition-property` suppression removed | | fails (`activations` 0, expected 1), so the test still guards the product |

CI failure rate per shard, from PR runs of `ci.yml`:

| | before 05:00 UTC 2026-11-23 | 05:00–07:52 UTC (41 runs) | this PR |
|---|---|---|---|
| `checks-ui (1/3)` | 9/86 | 39/41 (95%) | 0/3 |
| `checks-ui (3/3)` | 2/87 | 22/41 (54%) | 0/7 |

Rerun proof on head 8148681, run 45138279133 (initial run plus `gh run rerun --job` attempts 2-9): `checks-ui (3/3)` passed 7 of 7 times and `checks-ui (1/3)` 3 of 3 times. At the old rates, the chance of these passes would be 0.46^7 ≈ 0.5% for shard 3 and 0.05^3 ≈ 0.01% for shard 1.

## Why `main` did not stop it

Hourly `main` CI runs `checks-ui`, and it went red on the first hourly run after the merge (05:29 UTC, run 45118053016), then again at 06:45 and 07:29. Ordinary `main` pushes run only `security-fast` by design (`OPENCLAW_CI_ON_PUSH`). `checks-ui` was selected on both source PRs by its path rules. So the defect was detected on `main` within an hour; the red hourly run had no follow-up action. This PR changes no workflow file.

Co-authored-by: Ayaan Zaidi <[email protected]>
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 P2 Normal backlog priority with limited blast radius. 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.

checks-ui (1/3) and (3/3) fail on unrelated PRs (toast, board-view, chat-attachment-handoff browser tests)

1 participant