Skip to content

fix(tests): Systems hero proof reads the issues icon before its button hosts it - #2321

Merged
bkudiess merged 1 commit into
openclaw:mainfrom
bkudiess:bkudiess-systems-hero-matrix-flake
Nov 18, 2026
Merged

bkudiess merged 1 commit into
openclaw:mainfrom
bkudiess:bkudiess-systems-hero-matrix-flake

Conversation

@bkudiess

Copy link
Copy Markdown
Collaborator

Related: main 1af2586, run 44195618442 (job 134436348813), first occurrence of this failure.

What Problem This Solves

Fixes: the UI test job intermittently fails SystemsPageProofTests.Hero_StateMatrixRetainsFocusAndGeometryAcrossMountedWidths with Assert.Single() Failure: The collection did not contain any matching items when the test reads a summary tile's icon right after the Systems page loads.

User Impact

User impact: no user-visible change. CI stops failing this proof on loaded runners; the product behavior it asserts is unchanged.

Why This Change Was Made

Each width step waited only for the page and content column widths, then looked up each summary tile's icon well once. The first width (1100) is the page's mounted width, so that wait can return before any layout pass. At that point the issues tile, a Button, can still have an empty template ContentPresenter: its content, including the icon well, is not in the visual tree yet.

Diagnostics captured at the failing read (4 local reproductions):

  • The issues Button and its ContentPresenter were loaded and laid out (512x34), but the presenter had no children.
  • Button.Content was the same StackPanel instance as at test setup, and a content-change callback never fired. Reactor did not remount or replace anything.

The per-width wait now also requires both summary icon wells to be in the visual tree, loaded and laid out, with diagnostics on timeout. The existing identity, size and geometry assertions are unchanged. Test-only.

Evidence

  • Reproduced on main locally under CPU load in class order: 1 of 5 and 3 of 8 SystemsPageProofTests runs, with the exact CI signature.
  • RED (main's test with the observed state injected in the first width step: the issues tile's same content set to null and back): 6 of 8 theory cases failed in 3 of 3 runs, at the icon-well lookup as in CI.
  • GREEN with the same injection: 8 of 8 in 3 of 3 runs.
  • GREEN without injection: Hero_StateMatrix* 20/20 idle and the whole class 10/10 under CPU burn on the pre-rebase head, plus 10/10 and 3/3 on the rebased head.

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 readiness wait in an existing native UI proof; this PR's UI test job runs it.

Validation

  • ./build.ps1: passed.
  • dotnet test ./tests/OpenClaw.Shared.Tests/OpenClaw.Shared.Tests.csproj: 5,910 passed, 29 skipped, 0 failed.
  • dotnet test ./tests/OpenClaw.Tray.Tests/OpenClaw.Tray.Tests.csproj: 6,755 passed, 0 failed.
  • .\scripts\validate-test-timing-patterns.ps1: passed.
  • Focused native runs (isolated profile, desktop lock), rebased head: dotnet test tests/OpenClaw.Tray.UITests --filter FullyQualifiedName~SystemsPageProofTests.Hero_StateMatrixRetainsFocusAndGeometryAcrossMountedWidths: 10/10 runs (8 cases each); whole SystemsPageProofTests class under CPU burn: 3/3. Pre-rebase head: 20/20 and 10/10 under burn.

Real Behavior Proof

  • Environment tested: local Windows 11 desktop, isolated tray profile, native UI test host.
  • PR head or commit tested: this branch's head on a912363c.
  • Exact steps or command run: dotnet test tests/OpenClaw.Tray.UITests --filter FullyQualifiedName~SystemsPageProofTests (whole class, under CPU burn) and the Hero_StateMatrix* filter; temporary diagnostics (not committed) dumped the issues tile's visual tree and tracked Button.Content changes.
  • Evidence after fix: all focused runs passed; RED reproduced the CI assertion deterministically with the injected state.
  • Observed result: the proof waits until both icon wells are rendered instead of reading before the first layout pass.
  • Screenshot or artifact links verified? N/A
  • Not verified or blocked: whether a rendered frame ever shows the empty presenter. The injected state survives one Rendering callback because layout runs after it; 13 diagnostic runs with per-frame tracking after a miss did not reproduce naturally. The added wait would time out, not pass, if the icon never rendered.

Security Impact

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

Compatibility and Migration

  • Backward compatible? Yes
  • Config or environment changes? No
  • Migration needed? 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.
Hanselman review

Dual-model review (Claude Opus 5.5 high, GPT-6 Astra long_context high) on base a912363c: no CRITICAL/HIGH findings; both confirmed the wait cannot pass vacuously and does not repair state. Applied: rebase onto current main (Opus, process), comment reworded to the observed cause (Opus LOW/MEDIUM), IsLoaded added to the timeout diagnostics (Opus LOW). Noted, no change: the wait and the following assertions are not atomic (both models); this is safe here because layout does not remove presenter content.

…n hosts it

Hero_StateMatrixRetainsFocusAndGeometryAcrossMountedWidths waited only for the
page and content column widths before reading each summary tile's icon well
once. The first width does not resize, so the wait can return before any
layout pass, while the issues tile's Button presenter does not yet host its
content. The content itself was never replaced. Also wait for both icon
wells to be in the visual tree, loaded and laid out, with diagnostics.
Test-only.

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

clawsweeper Bot commented Nov 18, 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 18, 2026
@clawsweeper

clawsweeper Bot commented Nov 18, 2026

Copy link
Copy Markdown

Codex review: needs maintainer review before merge.

What this changes

The Systems hero UI test waits for both summary icons to load and receive layout before checking their geometry.

Example: The test starts at its already-mounted width of 1100 pixels while the Issues button presenter still has no visual children.

  • Before: The width wait passes immediately, and the icon lookup can fail with Assert.Single.
  • After: The test waits for both icon wells to be loaded with positive dimensions, then runs the existing assertions.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) A focused and source-supported repair with reported native-harness validation; broader exact-head UI checks remain in progress.
Proof confidence 🦐 gold shrimp (3/6) This test-only repair needs no shipped-entry-point demonstration; the body supplies scoped native-harness reproduction and passing-run reports, which this review did not independently execute.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Test only · Worth it: Yes · Fix scope: Complete
User problem: Intermittent native UI proof failures interrupt CI despite unchanged Systems behavior.
Reason: The maintainer-authored change addresses an observed readiness gap with the existing test infrastructure and preserves the original contract.

Merge readiness

✅ Ready for maintainer review

This PR is a focused, useful test-readiness repair that is absent from current main. No actionable defects were found; maintainer authorship also prevents automatic closure.

Priority: P2
Reviewed head: 6e7d18531b26ce8b4df43a62b51068250677ff67

Before merge

None.

Findings

None.

Agent review details

How this fits together

The native UI test mounts SystemsPageView with synthetic inventory, resizes its WinUI surface, and checks retained controls, focus, scrolling, and layout.

flowchart LR
  A[Synthetic inventory] --> B[Systems controller]
  B --> C[Mounted Systems page]
  C --> D[Bounded rendering wait]
  D --> E[Identity and geometry assertions]
Loading

Technical review

Best possible solution:

Retain this bounded icon-readiness check in the existing UI proof while preserving all subsequent rendering assertions.

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

Source confirms that the initial 1100-pixel width check can already be satisfied before the nested icon is ready; the author reports matching native reproductions, but this read-only review ran no tests.

Is this the best way to solve the issue?

The smallest complete fix extends the existing bounded rendering wait to the controls immediately inspected; it neither repairs product state nor suppresses a permanently missing icon.

AGENTS.md: found and applied where relevant.

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

Provenance checked

  • Systems hero rendering proof keeps the original intent (f059221: The Systems feature added mounted-width coverage to protect retained identity, focus, and responsive geometry.)

Testing

Proof path: in-process harness.

Security

None.

Evidence

What I checked:

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 scope Production +0/-0; tests +15/-2 The growth supplies a concrete readiness predicate and timeout diagnostics within the existing native test.

Labels

Label changes:

  • add P2: Repairs an evidenced intermittent CI failure without changing shipped user 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 evidenced intermittent CI failure without changing shipped user 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 18, 2026, 4:35 PM ET / 21:35 UTC.

@bkudiess
bkudiess merged commit cf58b63 into openclaw:main Nov 18, 2026
36 checks passed
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