Skip to content

fix(tests): wait for onboarding cards before invocation - #1646

Merged
shanselman merged 1 commit into
mainfrom
shanselman-fix-ui-card-readiness
Oct 6, 2026
Merged

shanselman merged 1 commit into
mainfrom
shanselman-fix-ui-card-readiness

Conversation

@shanselman

@shanselman shanselman commented Oct 6, 2026 •

Copy link
Copy Markdown
Collaborator

What Problem This Solves

Fixes framework onboarding tests invoking an AI action card before that exact card is ready.

User Impact

No product UX or control behavior changes. Framework tests synchronize against the target card rather than treating parent-panel visibility and a dispatcher yield as readiness proof.

Why This Change Was Made

Wait up to 10 seconds for loaded, enabled, click-enabled cards attached to the page's non-null XamlRoot. Preserve strict assertions and XAML-wired handler verification, with diagnostics for each readiness condition. Native input/compositor proof is separate and unchanged.

Adapted from #1559 (fix(tests): wait for onboarding cards before invocation), original head 8912d67fb87ad7bc5b49f4e41c96bbbcd5fa7ceb. Its author closed it unmerged October 1. Inspected comments, reviews, inline discussion and timeline contain no human rejection or stated closure reason. This PR does not reopen it or claim a known closure intent. Original author metadata is preserved with the Copilot co-author trailer.

Only the AI framework invocation seam, regressions and test-coverage documentation change. No product code, native publication waits, workflow files, fixture refactors or CI-speed optimizations.

Evidence

Current-head local framework proof: all 77 ARM64 AI cases passed, including four new regressions and existing strict XAML-handler rejection cases. Hosted CI also passed: 19 functional tests, 445 Tray UI tests (14 skipped), 23 accessibility tests.

Required rubber-duck review completed. Parent-authorized app-native Hanselman review used Claude Opus 5.5/high and GPT-6 Astra/high/long_context on 1ab07907: neither found blocking defects. Low-only limitations retained without scope expansion: detach tests overlap load/root gates; no dedicated mismatched-root fixture; task draining in cleanup may mask the first failure message but still fails correctly. CLI autoreview was attempted against the exact commit but unavailable because codex is not installed. No host tooling/configuration changes made.

Change Type

  • Bug fix
  • Tests or validation

Scope

  • Tests, CI, or docs

Required proof pools

  • none: framework-only synchronization, not product UI, native input, compositor, architecture-specific runtime, installer or gateway behavior. Actual WinUI framework execution was performed on ARM64; no native screenshot proof claimed.

Validation

Frozen head 1ab07907ef93644068e186ce552757c0b32e388f; OPENCLAW_REPO_ROOT points to this worktree and all three tray roots are session-isolated. Fresh test projects were built before --no-restore, preventing a zero-test no-op.

  • .\build.ps1: all five projects passed.
  • dotnet build .\tests\OpenClaw.Shared.Tests\OpenClaw.Shared.Tests.csproj --verbosity quiet: passed.
  • dotnet test .\tests\OpenClaw.Shared.Tests\OpenClaw.Shared.Tests.csproj --no-restore: 4,232 passed, 36 skipped, 0 failed.
  • dotnet build .\tests\OpenClaw.Tray.Tests\OpenClaw.Tray.Tests.csproj --verbosity quiet: passed.
  • dotnet test .\tests\OpenClaw.Tray.Tests\OpenClaw.Tray.Tests.csproj --no-restore: 3,899 passed, 0 skipped, 0 failed.
  • .\scripts\run-proof-tests.ps1 -Project 'tests\OpenClaw.Tray.UITests\OpenClaw.Tray.UITests.csproj' -Filter 'FullyQualifiedName~OnboardingAiPageTests&Category!=NativeOnboardingProof' -ResultName 'onboarding-card-readiness' -RuntimeIdentifier win-arm64: 77 passed, 0 skipped, 0 failed; 22.7421 seconds. TRX verifies non-zero tests.
  • git diff --check: passed.
  • Hosted CI run 37418019492: success on exact head. Functional 19 passed; Tray UI 445 passed/14 skipped; accessibility 23 passed; CI Gate, fast validation and proof-pool contracts passed.
  • Security run 37418019347: C# security, Actions security and advanced setup gate passed.

Base compatibility: predecessor #1645 (fix(audio): bound process cleanup without racing disposal) merged as e23f43a1a216fef8db23feca122b89f62ae71cc8. Its five changed files are disjoint from this patch; inspected process-owner changes do not affect the card/framework seam. git merge-tree --write-tree origin/main HEAD succeeds with combined tree c5929eb7165e77f8447f8846cf83cbf1386d2c8f; delta from current main is exactly this three-file patch. No blind rerun or branch rewrite performed.

Real behavior proof

  • Environment tested: Windows ARM64, .NET SDK 10.0.401, real WinUI fixture with isolated roaming/local/localappdata roots; native proof environment unset.
  • PR head tested: 1ab07907ef93644068e186ce552757c0b32e388f.
  • Exact steps: framework command above. Hold the real Local AI card unready, begin invocation, assert no action/completion, release readiness, then assert exactly one action/completion. Permanent click-disable must time out without invocation.
  • Copied current-head TRX evidence:
LocalAi_InvocationWaitsForCardReadiness(IsLoaded): Passed; 00:00:00.0987038
LocalAi_InvocationWaitsForCardReadiness(IsEnabled): Passed; 00:00:00.1550983
LocalAi_InvocationWaitsForCardReadiness(IsClickEnabled): Passed; 00:00:00.0637759
LocalAi_ReadinessTimeoutReportsCardStateWithoutInvoking: Passed; 00:00:10.1090290
Proof tests reported: total=77; Passed=77
  • Observed result: delayed readiness releases exactly one invocation; permanent blocking fails after the bounded wait with all diagnostics and zero actions. Strict handler tests still pass.
  • Screenshot/artifact links verified: N/A for copied framework output. Hosted run links were read successfully; local TRX/logs retained in session validation artifacts.
  • Not verified: native input/compositor and real gateway paths are unchanged and not claimed. Original intermittent CI scheduling was not recreated; deterministic forced unreadiness exercises its failing precondition. Combined post-predecessor tree was checked for compatibility, not rebuilt locally while another lane owned the heavy-validation slot.

Security Impact

No new permissions, capabilities, secret handling, network calls, execution surface or data access.

Compatibility and Migration

Backward compatible. No configuration/environment changes or migration.

Review Conversations

No inline review conversations were present at closeout; both app-native reviews reconciled.

Adapt the framework readiness seam from closed unmerged PR #1559, original commit 8912d67. Wait for the exact AI action card without changing native input or product behavior, retain strict XAML handler checks, and add delayed-state and timeout regressions.

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

clawsweeper Bot commented Oct 6, 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.

@shanselman shanselman added the status: 🚢 actively landing A maintainer or agent is actively driving this item through implementation, validation, or merge. label Oct 6, 2026
@clawsweeper clawsweeper Bot added P3 Low-risk cleanup, docs, polish, ergonomics, or speculative feature. proof: sufficient Contributor real behavior proof is sufficient. 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 Oct 6, 2026
@clawsweeper

clawsweeper Bot commented Oct 6, 2026

Copy link
Copy Markdown

Codex review: needs maintainer review before merge. Reviewed October 6, 2026, 1:22 AM ET / 05:22 UTC.

ClawSweeper review

What this changes

The PR makes onboarding framework tests wait for the exact AI action card to become ready, adds delayed-readiness and timeout regressions, and documents the test contract.

Merge readiness

✅ Ready for maintainer review

This remains a useful, bounded test repair: current main lacks the readiness wait, and the earlier implementation closed unmerged. No blocking correctness or security defect was found.

Priority: P3
Reviewed head: 1ab07907ef93644068e186ce552757c0b32e388f

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused test repair with relevant real WinUI execution evidence and no identified blocking defect.
Proof confidence 🐚 platinum hermit (4/6) Sufficient (live_output): Copied current-head ARM64 WinUI runtime results directly exercise the changed framework invocation owner: delayed readiness prevents invocation until released, and permanent blocking times out without actions. Native input and gateway behavior are unchanged; no stored-data contract changes.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (live_output): Copied current-head ARM64 WinUI runtime results directly exercise the changed framework invocation owner: delayed readiness prevents invocation until released, and permanent blocking times out without actions. Native input and gateway behavior are unchanged; no stored-data contract changes.
Evidence reviewed 7 items Pinned introduced change: The merge-base-to-head diff contains only two test files and one documentation file. The verified test-merge result has the same three-file scope: 95 additions and 4 deletions.
Bounded wait preserves strict invocation: The wait requires loaded, enabled, click-enabled cards on the page's non-null matching XamlRoot. Invocation independently retains readiness assertions and exact XAML handler validation. The existing rendering wait removes its event subscription in finally.
Current main still needs the repair: At fetched main, the shared helper immediately asserts readiness, and the AI invocation wrapper invokes before yielding. The new wait is absent from that original blob. The supplied latest release is v2026.9.4; no merged fixing PR or shipped implementation of this change was established.
Findings None None.
Security None None.

How this fits together

Windows onboarding framework tests mount the real setup page in a WinUI test window and invoke its XAML-wired card actions. The changed helper checks card readiness before invoking those actions; native keyboard and pointer proof uses a separate path.

flowchart TD
  A[Onboarding test scenario] --> B[Real WinUI setup page]
  B --> C[Target AI action card]
  C --> D{Card ready within 10 seconds?}
  D -->|Yes| E[Validate XAML handler and invoke]
  D -->|No| F[Fail with readiness diagnostics]
  E --> G[Assert action and completion]
Loading

Before merge

None.

Agent review details

Security

None.

Review metrics

Metric Value Why it matters
Production and test LOC production +0/-0, tests +94/-4, docs +1/-0 The repair adds focused test coverage without growing production code.

Technical review

Best possible solution:

Keep a single bounded framework readiness wait with strict handler validation and separate native-input coverage.

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

Yes for the readiness precondition: forced unloading or disabling exercises the immediate assertion gap visible in main. The original intermittent CI scheduling failure was not independently reproduced.

Is this the best way to solve the issue?

Yes. Reusing the existing bounded rendering wait before strict invocation is a narrow repair that preserves handler checks and the native proof boundary.

AGENTS.md: found and applied where relevant.

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

Labels

Label changes:

  • add P3: This is a bounded framework-test reliability improvement with no product behavior change.
  • add proof: sufficient: Contributor real behavior proof is sufficient. Copied current-head ARM64 WinUI runtime results directly exercise the changed framework invocation owner: delayed readiness prevents invocation until released, and permanent blocking times out without actions. Native input and gateway behavior are unchanged; no stored-data contract changes.
  • 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): Copied current-head ARM64 WinUI runtime results directly exercise the changed framework invocation owner: delayed readiness prevents invocation until released, and permanent blocking times out without actions. Native input and gateway behavior are unchanged; no stored-data contract changes.

Label justifications:

  • P3: This is a bounded framework-test reliability improvement with no product 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): Copied current-head ARM64 WinUI runtime results directly exercise the changed framework invocation owner: delayed readiness prevents invocation until released, and permanent blocking times out without actions. Native input and gateway behavior are unchanged; no stored-data contract changes.
  • proof: sufficient: Contributor real behavior proof is sufficient. Copied current-head ARM64 WinUI runtime results directly exercise the changed framework invocation owner: delayed readiness prevents invocation until released, and permanent blocking times out without actions. Native input and gateway behavior are unchanged; no stored-data contract changes.

Evidence

What I checked:

  • Pinned introduced change: The merge-base-to-head diff contains only two test files and one documentation file. The verified test-merge result has the same three-file scope: 95 additions and 4 deletions. (1ab07907ef93)
  • Bounded wait preserves strict invocation: The wait requires loaded, enabled, click-enabled cards on the page's non-null matching XamlRoot. Invocation independently retains readiness assertions and exact XAML handler validation. The existing rendering wait removes its event subscription in finally. (tests/OpenClaw.Tray.UITests/TestSupport.cs:26, 1ab07907ef93)
  • Current main still needs the repair: At fetched main, the shared helper immediately asserts readiness, and the AI invocation wrapper invokes before yielding. The new wait is absent from that original blob. The supplied latest release is v2026.9.4; no merged fixing PR or shipped implementation of this change was established. (tests/OpenClaw.Tray.UITests/TestSupport.cs:27, b1a41be1b8ae)
  • Current-head framework runtime evidence: The captured PR body reports real Windows ARM64 WinUI execution on this exact head: 77 focused cases passed. Copied results cover three delayed-readiness cases and a 10.109-second timeout. The corresponding source asserts zero actions while blocked, exactly one action after readiness returns, and zero actions on timeout. Required build, Shared tests, and Tray tests are also reported passing; this read-only review did not execute them. (tests/OpenClaw.Tray.UITests/OnboardingAiPageTests.cs:1394, 1ab07907ef93)
  • Framework and native proof boundary: The native invocation branch returns before the changed framework wrapper. Repository proof-pool documentation explicitly separates XAML-wired framework actions from native input and compositor proof, supporting the PR's none declaration for this test-only change. (docs/PROOF_POOLS.md:23, 1ab07907ef93)
  • Earlier PR is closed unmerged: GitHub confirms fix(tests): wait for onboarding cards before invocation #1559 (fix(tests): wait for onboarding cards before invocation) closed on October 1 without merging. Its inline comments and reviews are empty. It is prior work being adapted, not a merged fix or viable competing landing candidate. (8912d67fb87a)

Likely related people:

  • bkudiess: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • karkarl: 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.

@shanselman
shanselman merged commit 2e5e219 into main Oct 6, 2026
28 checks passed
@shanselman
shanselman deleted the shanselman-fix-ui-card-readiness branch October 6, 2026 05:36
@shanselman shanselman removed the status: 🚢 actively landing A maintainer or agent is actively driving this item through implementation, validation, or merge. label Oct 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

P3 Low-risk cleanup, docs, polish, ergonomics, or speculative feature. proof: sufficient Contributor real behavior proof is sufficient. 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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants