Skip to content

test(chat): guard session flyout identity - #1035

Merged
shanselman merged 3 commits into
mainfrom
shanselman-fix-stable-chat-picker
Jul 20, 2026
Merged

test(chat): guard session flyout identity#1035
shanselman merged 3 commits into
mainfrom
shanselman-fix-stable-chat-picker

Conversation

@shanselman

@shanselman shanselman commented Jul 20, 2026

Copy link
Copy Markdown
Collaborator

Summary

Adds real WinUI regression coverage for #970. Current main already contains the production fix from #991 and #984: the composer uses a declarative ContentFlyout, and FunctionalUI preserves the native flyout by render path.

The new test exercises the actual UiRenderer, Button, and WinUI Flyout lifecycle. It proves repeated Agent thinking-style status renders keep the picker open, session rows and selection still reconcile, the latest callback runs once, and mark-and-sweep pruning closes and releases a removed picker.

CI hang root cause and hardening

The first PR run (29777215014, job 88469448341) reached xUnit startup but emitted no completed test or TRX before the one-hour cancellation. The test had an unbounded _ui.RunOnUIAsync around Flyout.ShowAt; if WinUI stalled opening the popup against UIThreadFixture's default off-screen 1x1 host, the later five-second Opened timeout was never reached.

The test now owns its host geometry before ShowAt, bounds every UI-dispatch await to ten seconds, awaits popup closure during cleanup, detaches the flyout/content, restores the shared host geometry, and avoids creating an extra post-prune flyout. A future UI stall fails with a bounded diagnostic instead of consuming the job timeout.

Validation

Current head: 8c3562d9a73cbe0a6aecd383c827f85a0e1117f2

  • .\build.ps1 — passed; all five source projects built.
  • dotnet test .\tests\OpenClaw.Shared.Tests\OpenClaw.Shared.Tests.csproj --no-restore — 2,927 passed, 31 skipped, 0 failed.
  • dotnet test .\tests\OpenClaw.Tray.Tests\OpenClaw.Tray.Tests.csproj --no-restore — 1,834 passed, 0 failed.
  • dotnet test .\tests\OpenClawTray.FunctionalUI.Tests\OpenClawTray.FunctionalUI.Tests.csproj -r win-x64 — 19 passed, 0 failed.
  • Focused FunctionalUiFlyoutIdentityTests — 1 passed, 0 failed.
  • Exact CI command, complete non-accessibility Tray UI suite under dotnet-coverage — run 1: 89 passed in 6.56s; run 2: 89 passed in 6.71s.
  • Hosted Build and Test run 29782799246, Run Tray UI Tests — passed in 19s on the updated head.
  • Red/green mutation proof: temporarily replaced CreateContentFlyout path caching with new Flyout() on each render; the focused test failed at native flyout identity. Production was restored with no production diff.
  • Final rubber-duck review — clean, no actionable findings.
  • Structured Codex autoreview — blocked before review by the helper's isolated runtime refusing its temporary CODEX_HOME; no source finding was produced.

Exact repeated command:

dotnet-coverage collect --output TestResults\TrayUI\coverage.cobertura.xml --output-format cobertura "dotnet test tests/OpenClaw.Tray.UITests --no-build -c Debug -r win-x64 --verbosity normal --results-directory TestResults\TrayUI --logger trx;LogFileName=OpenClaw.Tray.UITests.trx --filter Category!=Accessibility"

Real behavior proof

  • Ran the focused test with SLOW_UI_TESTS=1 in the real WinUI test host.
  • Computer Use observed the live window titled Session picker still open after thinking renders.
  • The accessibility tree simultaneously showed Agent thinking 3 and an open native popup containing Session Alpha and Session Beta; the run then passed row update, selection callback, and prune cleanup assertions.
  • An lvt capture independently identified WinUI 3 PopupRoot / FlyoutPresenter and the session rows while the picker was open.
  • Not verified / blocked: a gateway-mediated live chat recording was not collected because the isolated deterministic test host has no paired gateway. The current-head real-WinUI proof directly drives the renderer behavior responsible for Windows Companion: "Agent thinking" animation closes the chat/session selectbox before a different chat can be chosen #970 without depending on gateway timing.

Closes #970.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: d693a171-cbf1-41c9-86b8-47735e737723
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: d693a171-cbf1-41c9-86b8-47735e737723
@shanselman
shanselman merged commit 93b645c into main Jul 20, 2026
18 checks passed
@shanselman
shanselman deleted the shanselman-fix-stable-chat-picker branch July 20, 2026 22:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Windows Companion: "Agent thinking" animation closes the chat/session selectbox before a different chat can be chosen

1 participant