Skip to content

test(setup): fast-validation fails on main because setup tests look up the companion without waiting - #2153

Merged
bkudiess merged 1 commit into
openclaw:mainfrom
bkudiess:bkudiess-ratchet-uia-waits
Nov 13, 2026
Merged

bkudiess merged 1 commit into
openclaw:mainfrom
bkudiess:bkudiess-ratchet-uia-waits

Conversation

@bkudiess

Copy link
Copy Markdown
Collaborator

Related: #2127, #2141

What Problem This Solves

Fixes: fast-validation and Run Tray Tests fail on main (run 43373652870), so every open PR fails them too.

#2127 merged on a base from before #2141 and added seven null-forgiving SetupCompanion.Find(page)! lookups. The #2141 test-timing ratchet rejects these (one-shot-uia-lookup: 717 occurrences against a baseline of 710).

User Impact

User impact: none. This is a test-only change that unblocks CI for main and every open PR.

Why This Change Was Made

SetupCompanion.Find walks the page's visual-tree ancestors and returns null until the page is mounted in the setup composition. A null-forgiving lookup asserts that the companion is there without waiting for it.

  • New helper OnboardingNativeProof.CompanionAsync(page): gets the companion inside a bounded, named TestSupport.WaitForRenderedConditionAsync and returns that result. This is the pattern the ratchet asks for.
  • AssertFixedPageChrome and AssertProgress became AssertFixedPageChromeAsync and AssertProgressAsync, and all 14 call sites await them.
  • Every improve(setup): restyle the setup wizard with the two-pane companion design #2127 assertion is unchanged, and the ratchet baseline is not raised.
  • No yield is added in the normal case: the wait checks its condition first and returns at once when the companion is already there. So the geometry checked between neighboring assertions is unchanged.

Evidence

  • .\scripts\validate-test-timing-patterns.ps1 on this branch: "Test timing pattern ratchet passed". It failed on main 85c8ffa6 with the same seven lines CI reported.
  • Both reviewers confirmed:
    • every call site is awaited on the UI thread;
    • no assertion changed;
    • a companion that never appears still fails, now with a named timeout instead of a NullReferenceException.

Change Type

  • Bug fix
  • Feature
  • Refactor
  • Docs or instructions
  • Tests or validation
  • Security hardening
  • Chore or infrastructure

Scope

  • Tray or WinUI UX
  • Windows node capability
  • Local MCP or winnode
  • Gateway, connection, or pairing
  • Setup or onboarding
  • Permissions, privacy, or security
  • Tests, CI, or docs

Required proof pools

  • none: test-only change to how existing setup UI tests look up an element. CI's Tray UI jobs run the affected classes. No capacity-dependent custom pool is required.

Validation

Tested on base 85c8ffa6 with the committed tree (commit 6bb4d59e).

  • .\scripts\validate-test-timing-patterns.ps1: passed.
  • ./build.ps1: all builds succeeded.
  • dotnet test ./tests/OpenClaw.Tray.Tests/OpenClaw.Tray.Tests.csproj: 6,410 passed, 0 failed.
  • Native run of the three affected classes, under the shared desktop lock:
    • Filter: FullyQualifiedName~OnboardingWindowsFlowTests|FullyQualifiedName~NativeSharedFlowTests|FullyQualifiedName~OnboardingAiPageTests.
    • Result: 178 passed, 14 failed.
    • All 14 failures are Category=NativeOnboardingProof tests, which CI's Tray UI filters exclude. They require a reviewed-proof setup: OPENCLAW_UI_PROOF_DIR plus a source freeze and manifest SHA. They failed on those preconditions. With OPENCLAW_UI_PROOF_DIR set, 12 failed only on the freeze precondition.
    • LocalAi_FullWindowShowsHeadingStateGroupsAndFooter fails earlier, at OnboardingAiPageTests.cs:1294. That is a footer-row structure assertion that runs before any companion lookup, so this diff does not affect it. It is a proof-only test that CI does not run, and it was not investigated further.
  • Shared tests were not rerun: this diff touches only Tray UI test files.
  • Review: short Hanselman dual-model review (Claude Opus 5.5, GPT-6 Astra long-context; high reasoning).
    • No CRITICAL, HIGH or MEDIUM findings.
    • One LOW (Opus only), not changed: the timeout message could add diagnostics about why the companion is missing.

Real Behavior Proof

  • Environment tested: Windows 11 dev box, in-process native WinUI UI tests, Debug win-x64, isolated tray profiles.
  • PR head or commit tested: 6bb4d59e.
  • Exact steps or command run: see Validation.
  • Evidence after fix: the ratchet passes. The 178 non-proof tests in the affected classes pass, including those that call AssertFixedPageChromeAsync, AssertProgressAsync and the converted NativeSharedFlowTests sites.
  • Observed result: as above.
  • Screenshot or artifact links verified? (Yes/No/N/A) N/A
  • Not verified or blocked:
    • CI's first-attempt result is pending.
    • The NativeOnboardingProof tests need a reviewed source-freeze setup and are not run in CI.

Security Impact

  • New permissions or capabilities? (Yes/No) No
  • Secrets or tokens handling changed? (Yes/No) No
  • New or changed network calls? (Yes/No) No
  • Command or tool execution surface changed? (Yes/No) No
  • Data access scope changed? (Yes/No) No
  • If any answer is Yes, explain the risk and mitigation:

Compatibility and Migration

  • Backward compatible? (Yes/No) Yes
  • Config or environment changes? (Yes/No) No
  • Migration needed? (Yes/No) No
  • If yes, list the exact upgrade steps:

Review Conversations

  • I replied to or resolved every bot review conversation addressed by this PR.
  • I left unresolved only conversations that still need maintainer judgment.

…p the companion without waiting

openclaw#2127 added seven null-forgiving SetupCompanion.Find(page)! lookups, which the test-timing ratchet rejects. Acquire the companion inside a bounded named wait (OnboardingNativeProof.CompanionAsync) and use that capture. AssertFixedPageChrome and AssertProgress become async and every call site awaits them. All assertions are unchanged and the ratchet baseline is not raised.

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

clawsweeper Bot commented Nov 13, 2026 •

Copy link
Copy Markdown

🦞👀
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 priority bug or improvement with limited blast radius. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. 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 13, 2026
@clawsweeper

clawsweeper Bot commented Nov 13, 2026

Copy link
Copy Markdown

Codex review: needs maintainer review before merge.

What this changes

This PR replaces seven immediate setup-companion lookups with a shared bounded wait while preserving existing assertions.

Example: Fast validation scans NativeSharedFlowTests.cs after the setup redesign.

  • Before: Three immediate companion lookups exceed that file's baseline of zero and fail validation.
  • After: The tests capture the companion through the existing rendered-condition wait, and head fast-validation passes.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) Focused and source-correct, supported by a passing ratchet check and reported native harness results; affected UI CI remained in progress.
Proof confidence 🦐 gold shrimp (3/6) No shipped behavior changes; the body reports current-head native WinUI test execution, and exact-head fast-validation passes. Inspected setup screenshots belong to linked redesign context and do not prove this wait change.
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 validation because setup tests exceed the accepted timing-pattern baseline.
Reason: The maintainer-authored repair resolves a verified CI failure while preserving the redesigned setup coverage and established timing policy.

Regression provenance

Possible regression — probable (reviewed change; failure trace). No predecessor PR is attributed.

Merge readiness

✅ Ready for maintainer review

Keep open: this collaborator-authored PR repairs a verified timing-ratchet failure still present on main; no introduced correctness defect was found.

Priority: P2
Reviewed head: 6bb4d59e929a7a232b6c09137c2605e71ef2b833

Before merge

None.

Findings

None.

Agent review details

How this fits together

Native onboarding tests inspect SetupWindow's mounted WinUI pages and sibling companion; the shared test helper waits for that companion before existing layout and progress assertions run.

flowchart LR
  A[Native onboarding tests] --> B[CompanionAsync]
  B --> C[Rendered condition wait]
  C --> D[SetupCompanion Find]
  D --> E[Mounted visual tree]
  B --> F[Existing layout and progress assertions]
Loading

Technical review

Best possible solution:

Use the existing rendered-condition wait to capture the companion once available, preserving all setup assertions and the ratchet baseline.

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

Main retains the seven immediate lookups named by the failed CI annotations; source and recorded failures establish the ratchet violation without executing target code.

Is this the best way to solve the issue?

The patch is the smallest complete repair: one reused wait mechanism, one shared capture helper, and awaited callers with unchanged assertions.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 85c8ffa61872.

Provenance checked

  • Companion acquisition in setup UI assertions keeps the original intent (d8e458d: The setup redesign moved mascot and timeline presentation into a shared companion and updated tests to inspect it.)
  • Awaited onboarding chrome and progress assertions keeps the original intent (3eed1f1: The onboarding flow tests protect mounted page layout and route-progress behavior; the PR changes acquisition timing while retaining their expectations.)

Testing

Proof path: in-process harness.

Security

None.

Evidence

What I checked:

Likely related people:

  • Barbara Kudiess: Raw commit 6ddc13b adds tests/OpenClaw.Tray.UITests/OnboardingNativeProof.cs:374 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 6ddc13b8eff7; files: tests/OpenClaw.Tray.UITests/OnboardingNativeProof.cs)
  • Pedro Larroy: Raw commit b6c849e adds tests/OpenClaw.Tray.UITests/OnboardingNativeProof.cs:32 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: medium; commits: b6c849e8ed44; files: tests/OpenClaw.Tray.UITests/OnboardingNativeProof.cs)
  • Dallin Romney: Raw commit 8dfedf9 adds tests/OpenClaw.Tray.UITests/OnboardingWindowsFlowTests.cs:821 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: low; commits: 8dfedf9616c5; files: tests/OpenClaw.Tray.UITests/OnboardingWindowsFlowTests.cs)

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.

Review metrics

Metric Value Why it matters
Change footprint Production +0/-0; tests +36/-23 The shared 13-line helper serves seven lookup sites across three suites without adding test cases or production machinery.

Labels

Label changes:

  • add P2: Repairs an observed main-branch validation failure that obstructs PR checks without changing shipped application behavior.
  • add rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp 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: Repairs an observed main-branch validation failure that obstructs PR checks without changing shipped application behavior.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp 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 13, 2026, 1:36 AM ET / 06:36 UTC.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

P2 Normal priority bug or improvement with limited blast radius. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. 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