Skip to content

fix(tests): desktop lobster scale and reconcile tests read the mascot mood before it renders - #2181

Merged
bkudiess merged 1 commit into
openclaw:mainfrom
bkudiess:bkudiess-lobster-mood-sibling-waits
Nov 13, 2026
Merged

bkudiess merged 1 commit into
openclaw:mainfrom
bkudiess:bkudiess-lobster-mood-sibling-waits

Conversation

@bkudiess

Copy link
Copy Markdown
Collaborator

What Problem This Solves

Fixes: two desktop lobster UI tests fail intermittently in CI because they read the mascot's mood before the mascot has rendered a notification's arrival.

User Impact

User impact: no product change. DesktopCompanionWindowTests stops producing intermittent MascotScale_… and Reactor_ReconcilesNotifications_… failures.

Why This Change Was Made

The mascot and the notification bubble reconcile on separate Reactor hosts. Each re-renders independently after presentation.Changed, so bubble layout or bubble message text does not mean the mascot has applied the arrival mood. #2178 fixed this for Notification_UsesExistingMascot_ShowsLiteralText_AndDismissesLocally. This PR applies the same pattern to the two remaining tests with the same race:

  • MascotScale_UpdatesLayoutAndHitRegionWithoutScalingOrReplacingPopup captured originalMood after bubble layout alone. If the arrival mood rendered later, it landed during the scaling loop and failed the final mood checks.
  • Reactor_ReconcilesNotifications_RetainsMascot_AndDoesNotReplayOnThemeChange read the first-arrival mood once after the message text appeared, and checked the second arrival's two mood changes (Idle, then Happy) once.

Following #2178, each test now waits with one combined WaitForRenderedConditionAsync condition across both hosts, with a diagnostics lambda, then keeps Assert.Same and the existing final assertions. No assertions were removed. The scale test gains an Assert.Same on the mascot. No sleeps or retries were added; this is a test-only change and #2178's notification test is unchanged.

Evidence

Check Result
RED: 40-iteration probe on main (ff530013e) Reactor test first-arrival mood not yet applied 1/40, second-arrival change count not yet 2 in 2/40; scale test's captured mood not yet applied 4/40
RED: main's unmodified tests, 15 runs MascotScale(chatOpen: True) failed 3/15: expected Idle, actual Happy at the final mood check
GREEN: the three mascot-mood tests with this change 20/20 runs (140 executions), on a binary verified to contain the change
GREEN: whole DesktopCompanionWindowTests class 5/5 runs (21 passed, 3 skipped each)

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: a test-only synchronization change, proven by the native UI test class itself in hosted CI.

Validation

  • ./scripts/validate-test-timing-patterns.ps1: passed.
  • ./build.ps1: passed.
  • dotnet test ./tests/OpenClaw.Shared.Tests/OpenClaw.Shared.Tests.csproj: passed, 5,862 passed, 29 skipped, 0 failed.
  • dotnet test ./tests/OpenClaw.Tray.Tests/OpenClaw.Tray.Tests.csproj: passed, 6,489 passed, 0 failed.
  • Native UI under the shared desktop lock with isolated tray data roots: the RED and GREEN runs above.
  • Hanselman dual-model review (Claude Opus 5.5 high, GPT-6 Astra long_context high): no CRITICAL, HIGH or MEDIUM findings. Both confirmed that each wait can only pass after the intended state, that the second arrival's exact count of 2 cannot be met early, and that the theme replay probe now starts from a settled state. One optional LOW comment suggestion was not applied.

Real Behavior Proof

  • Environment tested: local Windows 11 desktop, isolated OPENCLAW_TRAY_DATA_DIR, OPENCLAW_TRAY_APPDATA_DIR and OPENCLAW_TRAY_LOCALAPPDATA_DIR.
  • PR head or commit tested: f8e57b5 (base ff53001)
  • Exact steps or command run: dotnet test tests/OpenClaw.Tray.UITests --no-build -c Debug -r win-x64 --filter "FullyQualifiedName~DesktopCompanionWindowTests.MascotScale|FullyQualifiedName~DesktopCompanionWindowTests.Reactor_Reconciles|FullyQualifiedName~DesktopCompanionWindowTests.Notification_UsesExistingMascot", 20 times; the whole class 5 times.
  • Evidence after fix: 20/20 and 5/5 passed.
  • Observed result: no early mood reads; diagnostics name the mood, change count and text if a wait ever times out.
  • Screenshot or artifact links verified? N/A
  • Not verified or blocked: the hosted CI run of this PR.

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: N/A

Compatibility and Migration

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

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.

… mood before it renders

The mascot and the notification bubble reconcile on separate Reactor hosts,
so bubble layout or message text does not mean the mascot has rendered the
arrival mood. MascotScale captured its original mood too early and could
then count the arrival as a scaling change; the Reactor reconcile test read
the first-arrival mood and the second arrival's two mood changes once.
Wait for the combined bubble and mascot condition with diagnostics, as
openclaw#2178 does for the notification test. Test-only.

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. P3 Low-risk cleanup, docs, polish, ergonomics, or speculative feature. 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. 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

The PR waits for both notification rendering and the mascot's expected mood before continuing two native UI tests.

Example: The scale test presents “Same popup” before testing 50%, 100%, 200%, and 75% mascot sizes.

  • Before: It can capture Idle before the arrival renders Happy, then incorrectly attribute that mood change to scaling.
  • After: It waits for popup layout and Happy before recording the baseline and counting scaling-related mood changes.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) A focused, correct test repair with reported native harness validation; execution evidence is summarized in the body and hosted validation remains incomplete.
Proof confidence 🦐 gold shrimp (3/6) No shipped behavior changes; the body reports current-head native Windows UI repetitions and baseline failures, with hosted checks still running.
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 test failures create false CI failures for desktop companion scaling and notification reconciliation.
Reason: A narrow synchronization repair preserves meaningful coverage, follows the feature owner's merged precedent, and has maintainer-authored direction.

Merge readiness

✅ Ready for maintainer review

Keep open: this maintainer-authored PR repairs two remaining test synchronization races on main without weakening assertions; no introduced defect was found.

Priority: P3
Reviewed head: f8e57b5eedc8043e4deb79be9748831819174397

Before merge

None.

Findings

None.

Agent review details

How this fits together

DesktopCompanionWindow shares presentation state between separate Reactor hosts for the mascot and popup; the native UI tests must observe both hosts before asserting settled behavior.

flowchart TD
P[Presentation changes] --> M[Mascot Reactor host]
P --> B[Bubble Reactor host]
M --> W[Combined test readiness wait]
B --> W
W --> A[Scale and reconciliation assertions]
Loading

Technical review

Best possible solution:

Use the existing rendered-condition helper to settle both hosts while preserving scale, retained-control, and exact mood-replay assertions.

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

Independent host reconciliation permits the existing tests to observe bubble readiness before the mascot mood changes; the body also reports repeated baseline failures, which this review did not rerun.

Is this the best way to solve the issue?

The patch is the smallest complete repair: strengthen the three existing readiness conditions, retain their assertions, and add useful timeout diagnostics without new helpers or production changes.

AGENTS.md: found and applied where relevant.

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

Provenance checked

  • Desktop companion scale and reconciliation test readiness keeps the original intent (fbc0287: The desktop companion feature added tests for unchanged popup sizing, retained mascot identity, arrival reactions, and no theme-triggered replay.)

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.

Labels

Label changes:

  • add P3: This focused test reliability repair changes no shipped product 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:

  • P3: This focused test reliability repair changes no shipped product 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, 2:51 PM ET / 19:51 UTC.

@bkudiess
bkudiess merged commit 364842c into openclaw:main Nov 13, 2026
55 of 57 checks passed
bkudiess added a commit to bkudiess/openclaw-windows-node that referenced this pull request Nov 13, 2026
Picks up openclaw#2181, which fixes the racy desktop mascot test failing this PR's CI.

Co-authored-by: Copilot App <[email protected]>
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. 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