feat: explore and test the app without a live Gateway - #1439
shanselman wants to merge 3 commits into
Conversation
Add a deterministic loopback Gateway, disposable app profiles, guarded host side effects, interactive and automated launchers, and passive render observation. Keep normal connection/provider/rendering paths intact. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: f451834c-cdd8-41cf-994c-77c0a22208b9
Cover real Gateway parsing, profile and host isolation, concurrent apps, native session switching, 240-message visibility, delayed history delivery, and empty sessions. Document the known product regression without weakening its assertion. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: f451834c-cdd8-41cf-994c-77c0a22208b9
Pass the same optional wait arguments positionally so the review input scanner does not mistake C# CancellationToken named arguments for credential assignments. Test behavior is unchanged; all 29 protocol cases pass. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: f451834c-cdd8-41cf-994c-77c0a22208b9
|
🦞👀 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 maintainer review before merge. Reviewed September 17, 2026, 1:56 PM ET / 17:56 UTC (Revision 2). ClawSweeper reviewWhat this changesAdds a disposable simulated Gateway, launch scripts, native application tests, and explicit isolation guards so developers can explore populated conversations without a live Gateway. Merge readiness✅ Ready for maintainer review Keep open: this is a distinct, useful testing capability absent from current main, with convincing native-app evidence and no concrete introduced defect found. The retained scrolling failure belongs to the separately tracked product fix. Priority: P2 Review scores
Verification
How this fits togetherThe fixture supplies synthetic Gateway responses to the Windows app's existing connection, history, and rendering stack. Local MCP and Windows UI Automation drive the app and collect assertions and artifacts. flowchart LR
A[Explicit built app] --> B[Fixture launcher]
B --> C[Disposable profile and credentials]
B --> D[Loopback simulated Gateway]
C --> E[Real Windows app]
D --> E
F[MCP and native UI automation] --> E
E --> G[Assertions and captured artifacts]
Before mergeNone. Agent review detailsSecurityNone. Review metrics
Technical reviewBest possible solution: Keep synthetic data at the Gateway boundary, preserve strict native assertions, and maintain the opt-in harness independently of the scrolling repair. Do we have a high-confidence way to reproduce the issue? Not applicable to this feature PR. The inspected native screenshots and reported runs demonstrate the harness; the intermittent scrolling failure is separately tracked. Is this the best way to solve the issue? Yes. Supplying synthetic responses through the existing Gateway client exercises more production behavior than substituting a chat provider, while the explicit fixture guards preserve ordinary application behavior. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 3c43751b2bac. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (1 earlier review cycle)
|
Native UI evidence from the fixture harnessSuccessful Debug example: the real app displays the actual final message of the 240-message synthetic conversation. This is a harness demonstration, not an "after" screenshot for the separate scrolling fix. Known Release failure retained: after returning to the long conversation, the selected session is correct but the viewport is at messages 1-3. The harness failed its natural-tail assertion rather than repairing the scroll position or reporting success. This is tracked in #1437; the separate draft product fix is #1438 (fix(chat): restore the tail when switching conversations). Both captures contain only the fictional scenario and the target app window. The PR description preserves the latest Release result: 25 passing cases and one failed assertion. |


Related: #1437. The separate product fix is #1438 (fix(chat): restore the tail when switching conversations), currently a draft.
What Problem This Solves
Developers need to test the populated desktop application without provisioning a real Gateway, pairing a machine, or paying for AI calls.
User Impact
Developers can launch the real app against a fictional Gateway, browse several conversations and settings pages, and run repeatable native UI smoke tests. Each run owns its profile, credentials, ports and processes, so installed pairings are not imported.
There is no change to normal installed-app behavior unless the explicit fixture mode is enabled.
Known limitation: the strict Release session-tail test can fail on existing chat behavior tracked in #1437. This PR preserves that failure rather than weakening the test or changing production scrolling.
Why This Change Was Made
This adds the missing middle tier between unit/component tests and full system E2E. The fixture speaks the normal Gateway WebSocket protocol; the app still uses its real connection manager, chat provider, history loader and renderer.
The same synthetic scenario supports interactive exploration and automation: five sessions, 240 mixed-height messages, an empty conversation, model/agent data and read-only Gateway configuration. MCP handles discovery, readiness and navigation; UI Automation operates the actual session picker and scrollbar.
The changes stay focused: test-only server/run infrastructure, narrow WSL/autostart/toast isolation guards, and passive fixture-only render metadata. No production scrolling workaround, provider replacement, new AI dependency, or Gateway installation.
CI boundary: existing unit-test jobs pick up the new tests in their projects. The real-app fixture smoke remains opt-in. This PR does not add a required desktop CI check, edit workflows, or change branch protection. Mandatory CI promotion is a separate decision after the known runtime failure and runner reliability are addressed.
Evidence
winnode --list-toolsandapp.status; it exited successfully and removed its owned profile and process.Usage:
docs/GATEWAY_FIXTURE_TESTING.md.Change Type
Scope
winnodeRequired proof pools
windows-winui-interactive: populated native chat, actual picker/scrolling/navigation, isolated startup and MCP proof. Windows x64 proof collected; the known Release scrolling failure is retained.windows-11-arm64: the launcher has an ARM64 path, but native ARM64 execution was not available on this host.Validation
Windows x64. Required tests use an isolated settings directory and explicit repository root.
.\build.ps1dotnet test .\tests\OpenClaw.Shared.Tests\OpenClaw.Shared.Tests.csproj --no-restoredotnet test .\tests\OpenClaw.Tray.Tests\OpenClaw.Tray.Tests.csproj --no-restoredotnet test .\tests\OpenClaw.WinNode.Cli.Tests\OpenClaw.WinNode.Cli.Tests.csproj --no-restoreGatewayFixtureProtocolTestsGatewayFixtureProfileTestsandGatewayFixtureAppTests(--no-restore -r win-x64 -p:Platform=x64).\scripts\test-gateway-fixture.ps1 -AppPath '<Debug app>' -Screenshots.\build.ps1 -Project WinUI -Configuration Release.\scripts\test-gateway-fixture.ps1 -AppPath '<Release app>' -Configuration Release -Screenshots.\scripts\validate-docs.ps1andgit diff --checkStructured Codex reviews completed cleanly with no accepted/actionable findings:
The implementation and complete test/documentation range were reviewed separately to respect the helper's per-diff size limit, without truncating or omitting files. The final frozen-tree runs both exited 0. Full build and required suites were rerun on publication head
afc3e9f7e616bde264ed78490e6738d0c1bbbd44.Real behavior proof
DevBuild=false,System.Diagnostics.Debugger.IsSupported=false, and no attached debugger.afc3e9f7e616bde264ed78490e6738d0c1bbbd44. Full build/required tests, 22 real app/profile/MCP checks and final source review ran on this committed tree. The native UI evidence was collected from the identical production source in implementation commit7def9212; subsequent commits add tests/documentation and equivalent test-only cancellation argument formatting.run-gateway-fixture.ps1 -DurationSeconds 90exited 0; the generated profile and app process were both gone afterward. The same running app returned:{ "connectionStatus": "Connected", "overallState": "Ready", "operatorState": "Connected", "nodeState": "Disabled", "gatewayVersion": "fixture-1", "sessionCount": 5, "nodeCount": 0, "operatorScopes": ["operator.read"] }Security Impact
The explicit fixture guards suppress WSL keepalive/stale cleanup, Windows autostart writes and toast registration. Auto-start changes through local MCP also fail explicitly before saving. Normal isolated runs without the fixture flag retain their existing behavior. The supported workflow is browsing and safe local preferences, not a general OS sandbox.
Compatibility and Migration
OPENCLAW_GATEWAY_FIXTURE=1, isolated tray/setup roots, a dedicated MCP port, and safe fixture settings in the child process only. The app advertisesOpenClaw.GatewayFixtureIsolationVersion=1for preflight.Review Conversations