Repository navigation
fix(ci): Build and Test flakes when Workspace keyboard input or console tail polling runs late - #1597
Conversation
…le tail polling runs late - WizardConsoleTailTests: snapshot cursors inside onMessage so a late test continuation cannot record the next 500 ms poll. - WorkspaceWindowProofTests: wait for selection state across sidebar rebuilds instead of one-shot re-finds; foreground the Hub and wait for keyboard focus before SendKeys. - AccessibilityAppFixture: add EnsureHubForegroundAsync.
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: needs changes before merge. Reviewed October 2, 2026, 6:26 AM ET / 10:26 UTC (Revision 8). ClawSweeper reviewWhat this changesThe PR stabilizes console-tail and native Workspace tests with callback-time snapshots, selection and activation waits, pane-readiness synchronization, and a documented CI failure backlog. Merge readiness⛔ Needs changes before merge - 1 item remains This PR remains useful: current main retains the timing-sensitive assertions, and the stacked correction landed into this branch rather than main. No introduced correctness defect was found. Priority: P2 Review scores
Verification
How this fits togetherConsole-tail tests verify how onboarding receives new Gateway output. Workspace tests drive an isolated Windows app through navigation, session selection, keyboard activation, and draft preservation. flowchart TD
A[Gateway console output] --> B[Console tail polling]
B --> C[Callback snapshot assertions]
D[Isolated Windows app] --> E[Foreground and pane readiness]
E --> F[Workspace interactions]
F --> G[Selection and draft assertions]
C --> H[CI results]
G --> H
Before merge
Agent review detailsSecurityNone. Review metrics
Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Technical reviewBest possible solution: Keep deterministic test synchronization and dedicated native keyboard coverage, while investigating the documented session-selected keyboard uncertainty separately. Do we have a high-confidence way to reproduce the issue? Yes for the console-tail assertion race: a delayed continuation can observe another poll in the mutable cursor list. Native activation failures are documented, but their intermittent mechanism remains unresolved. Is this the best way to solve the issue? Yes for the bounded stabilization goal: callback snapshots and readiness waits preserve the existing assertions, while separate native keyboard coverage remains mandatory. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against d090a8110fa3. LabelsLabel changes: No label changes. Label justifications:
EvidenceWhat I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (7 earlier review cycles)
|
Retain Space activation and focus-transfer coverage in the dedicated native navigation test. Document the remaining session-selected keyboard uncertainty. Co-authored-by: Copilot App <[email protected]>
Use the existing foreground-and-focus helper for reopen-button Space and Tab. Local validation remains in progress; push requested to run CI in parallel. Co-authored-by: Copilot App <[email protected]>
Restore the foreground/focus barrier when switching from SendKeys to UIA Invoke. CI exposed a COM failure without that barrier. Do not suppress or retry invocation errors. Co-authored-by: Copilot App <[email protected]>
What Problem This Solves
Fixes timing-dependent
Build and Testfailures when console-tail continuations run after another poll or Workspace tests interact during sidebar rebuilds and native window activation.User Impact
No product behavior change. Current-head CI is green. This PR does not claim that every main-branch CI failure or the underlying intermittent keyboard-delivery issue is resolved.
Why This Change Was Made
NativePagesAndOwnerLinks_KeepCompanionIndependent. Collapse and reopen keyboard paths use the existing foreground/focus helper. No keyboard retries, fallback activation, or COM-error suppression were added.The original focus assertion proved focus before sending Space, not key delivery. Remaining uncertainty and unrelated failures are tracked in
docs/CI_FAILURES.md.Evidence
Current head
843d4f5f: Build and Test passed, including UI, functional, accessibility, tray/setup/integration, and CI Gate. CodeQL passed.The preceding head
bef916a9passed local required validation and 12/12 focused Workspace cases, but its CI run exposed a COM exception after the activation barrier was removed.843d4f5frestores that barrier and passes CI without suppressing the error.Change Type
Scope
winnodeRequired proof pools
none: test-only changes covered by existing hosted UI and tray jobs; no new capacity-dependent product proof requirement.Validation
Current-head hosted CI:
./scripts/Invoke-CiTest.ps1 -Project tests/OpenClaw.Tray.UITests -ResultsDirectory TestResults\TrayUI -TrxFileName OpenClaw.Tray.UITests.trx -Runtime win-x64 -Filter "Category!=Accessibility&Category!=NativeOnboardingProof" -HangTimeoutSeconds 300: 441 passed, 14 skipped, 0 failed../scripts/Invoke-CiTest.ps1 -Project tests/OpenClawTray.FunctionalUI.Tests -ResultsDirectory TestResults\FunctionalUI -TrxFileName OpenClawTray.FunctionalUI.Tests.trx -Runtime win-x64: 19 passed, 0 failed.dotnet test tests/OpenClaw.Tray.UITests --no-build -c Debug -r win-x64 --verbosity normal --results-directory TestResults\Accessibility --logger "trx;LogFileName=Accessibility.trx" --filter Category=Accessibility: 23 passed, 0 failed.Last completed local closeout,
bef916a9, native Windows ARM64, isolated tray roots andOPENCLAW_REPO_ROOTset:.\build.ps1: passed, all projects.dotnet test .\tests\OpenClaw.Shared.Tests\OpenClaw.Shared.Tests.csproj --no-restore: 4,223 passed, 34 skipped, 0 failed.dotnet test .\tests\OpenClaw.Tray.Tests\OpenClaw.Tray.Tests.csproj --no-restore: 3,862 passed, 0 failed.dotnet build .\tests\OpenClaw.Tray.UITests\OpenClaw.Tray.UITests.csproj -c Debug -r win-arm64 --no-restore: passed, one existing obsolete-API warning.dotnet test .\tests\OpenClaw.Tray.UITests\OpenClaw.Tray.UITests.csproj --no-build -c Debug -r win-arm64 --filter "FullyQualifiedName~WorkspaceWindowProofTests.SidebarSessions_SelectOriginalKeys_AndKeepCompanionDraft|FullyQualifiedName~WorkspaceWindowProofTests.NativePagesAndOwnerLinks_KeepCompanionIndependent": three consecutive runs, 4/4 each (12/12).Local revalidation of these commands on
843d4f5fis still running, separately from the completed hosted CI. An earlier shared-suite run hit the known MCP disposal flake; its isolated rerun and subsequent full suite passed. Local GitVersion abandoned-mutex failures were resolved for prior closeout by settingMSBUILDDISABLENODEREUSE=1; no build configuration was committed.python .agents\skills\autoreview\scripts\autoreview --mode commit --commit HEADwas attempted on21e31d1c, but Codex exited 1 on both attempts. No clean automated-review result is claimed.Real Behavior Proof
843d4f5ffddcac71e404b663209980bfe6c1e396in successful CI run 36987876649.Test Run Successful, 441 passed, 14 skipped; accessibility 23/23; functional UI 19/19.test-results-uidownloaded and TRX inspected. No screenshot proof of the latest correction is claimed.Historical console-tail proof from
e205c75f: a temporary 1,500 ms continuation delay made old tests fail 3/3 with extra cursors and fixed tests pass 3/3. The delay was removed before commit; this is historical rather than newly repeated proof.Security Impact
Yes/No) NoYes/No) NoYes/No) NoYes/No) NoYes/No) NoYes, explain the risk and mitigation: N/ACompatibility and Migration
Yes/No) YesYes/No) No product changes; local validation disabled MSBuild node reuse.Yes/No) NoReview Conversations