Skip to content

Commit 8b857ec

Browse files
shanselmanCopilot
andauthored
Refresh app and developer documentation (#915)
Update release links, project inventory, connection architecture, MCP mode, Windows node testing, and test coverage docs to match current app behavior. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
1 parent 14022dc commit 8b857ec

9 files changed

Lines changed: 93 additions & 47 deletions

File tree

AGENTS.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ Required steps:
1313
3. Run tray tests:
1414
- `dotnet test ./tests/OpenClaw.Tray.Tests/OpenClaw.Tray.Tests.csproj --no-restore`
1515

16+
This is the required local closeout subset for agents. CI also builds and runs additional connection, setup, CLI, UI, integration, and E2E suites; see `docs/TEST_COVERAGE.md` for the broader inventory.
17+
1618
If a command fails:
1719

1820
1. Fix the issue.

DEVELOPMENT.md

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,18 @@ openclaw-windows-hub/
4444
│ │ ├── Models.cs # Data models (SessionInfo, ChannelHealth, etc.)
4545
│ │ └── IOpenClawLogger.cs # Logging interface
4646
│ │
47+
│ ├── OpenClaw.Connection/ # Gateway registry, credentials, connection manager
48+
│ │
4749
│ ├── OpenClaw.Chat/ # Native chat model and reducer
4850
│ │ ├── ChatModels.cs # Threads, entries, events, provider contract
4951
│ │ └── ChatTimelineReducer.cs # Timeline state transitions
5052
│ │
53+
│ ├── OpenClaw.Cli/ # WebSocket connect/send/probe validator
54+
│ │
55+
│ ├── OpenClaw.WinNode.Cli/ # winnode local MCP/Windows-node CLI
56+
│ │
57+
│ ├── OpenClaw.SetupEngine/ # Local WSL gateway setup and setup-code support
58+
│ │
5159
│ ├── OpenClawTray.FunctionalUI/ # Small in-repo declarative WinUI helper
5260
│ │ └── FunctionalUI.cs # Components, hooks, elements, host control
5361
│ │
@@ -59,8 +67,12 @@ openclaw-windows-hub/
5967
│ │ └── Helpers/ # Icon generation, utilities
6068
│ │
6169
├── tests/
62-
│ ├── OpenClaw.Shared.Tests/ # Unit tests for shared library
63-
│ └── OpenClaw.Tray.Tests/ # Tests for tray helpers (menu, settings, deep links)
70+
│ ├── OpenClaw.Shared.Tests/ # Unit tests for shared library/capabilities/MCP
71+
│ ├── OpenClaw.Connection.Tests/ # Gateway registry and connection manager tests
72+
│ ├── OpenClaw.Tray.Tests/ # Tests for tray helpers (menu, settings, deep links)
73+
│ ├── OpenClaw.WinNode.Cli.Tests/ # winnode CLI contract tests
74+
│ ├── OpenClaw.SetupEngine.Tests/ # Setup engine tests
75+
│ └── OpenClaw.Tray.UITests/ # Native WinUI/A2UI UI tests
6476
6577
├── tools/
6678
│ └── icongen/ # Icon generation tool
@@ -76,16 +88,18 @@ openclaw-windows-hub/
7688
### Project Dependencies
7789

7890
```
79-
OpenClaw.Tray.WinUI ──depends on──▶ OpenClaw.Shared
80-
OpenClaw.Shared.Tests ──tests──▶ OpenClaw.Shared
81-
OpenClaw.Tray.Tests ──tests──▶ OpenClaw.Shared
91+
OpenClaw.Tray.WinUI ──depends on──▶ OpenClaw.Shared + OpenClaw.Connection + OpenClaw.Chat
92+
OpenClaw.WinNode.Cli ──depends on──▶ OpenClaw.Shared
93+
OpenClaw.SetupEngine ──supports──▶ local WSL gateway setup
94+
OpenClaw.*.Tests ──test──▶ corresponding shared, connection, tray, setup, and CLI surfaces
8295
```
8396

8497
### Key Subsystems
8598

8699
| Subsystem | Location | Purpose |
87100
|-----------|----------|---------|
88101
| **Gateway Communication** | `OpenClaw.Shared/OpenClawGatewayClient.cs` | WebSocket client with protocol v3, reconnect/backoff logic |
102+
| **Connection Management** | `OpenClaw.Connection/` | Gateway registry, credential precedence, pairing, tunnels, and reconnect policy |
89103
| **Notification System** | `OpenClaw.Tray.WinUI/App.xaml.cs` | Event routing, toast notifications, classification |
90104
| **WebView2 Integration** | `OpenClaw.Tray.WinUI/Windows/ChatWindow.xaml.cs` | Embedded chat panel with lifecycle management |
91105
| **Tray Icon Management** | `OpenClaw.Tray.WinUI/Helpers/IconHelper.cs` | GDI handle management, dynamic icon generation |

README.md

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,20 +21,24 @@ This monorepo contains the Windows hub, shared client libraries, and CLI utiliti
2121
| Project | Description |
2222
|---------|-------------|
2323
| **OpenClaw.Tray.WinUI** | System tray application (WinUI 3) for quick access to OpenClaw |
24-
| **OpenClaw.Shared** | Shared gateway client library |
24+
| **OpenClaw.Connection** | Gateway registry, credential resolution, and connection manager |
25+
| **OpenClaw.Shared** | Shared gateway client library, capabilities, and MCP bridge |
26+
| **OpenClaw.Chat** | Native chat model and timeline reducer |
2527
| **OpenClaw.Cli** | CLI validator for WebSocket connect/send/probe using tray settings |
28+
| **OpenClaw.WinNode.Cli** | `winnode` CLI for invoking local Windows node/MCP capabilities |
29+
| **OpenClaw.SetupEngine** | Local gateway setup, WSL installation, and setup-code support |
2630

2731
## 🚀 Quick Start
2832

2933
> **End-user installer?** Download the latest stable x64 or ARM64 installer from the [OpenClaw Windows docs](https://docs.openclaw.ai/platforms/windows), or see [docs/SETUP.md](docs/SETUP.md) for step-by-step installation (no build required).
3034
>
3135
> **Managed WSL gateway?** Local setup creates a locked-down app-owned `OpenClawGateway` distro. See [docs/WSL_GATEWAY_ADMIN.md](docs/WSL_GATEWAY_ADMIN.md) for editing `openclaw.json` as the `openclaw` user and using root for protected-file administration.
3236
33-
Direct downloads from the latest OpenClaw release:
37+
Direct downloads from the latest OpenClaw Windows release:
3438

35-
- [OpenClawCompanion-Setup-x64.exe](https://github.com/openclaw/openclaw/releases/latest/download/OpenClawCompanion-Setup-x64.exe)
36-
- [OpenClawCompanion-Setup-arm64.exe](https://github.com/openclaw/openclaw/releases/latest/download/OpenClawCompanion-Setup-arm64.exe)
37-
- [OpenClawCompanion-SHA256SUMS.txt](https://github.com/openclaw/openclaw/releases/latest/download/OpenClawCompanion-SHA256SUMS.txt)
39+
- [OpenClawCompanion-Setup-x64.exe](https://github.com/openclaw/openclaw-windows-node/releases/latest/download/OpenClawCompanion-Setup-x64.exe)
40+
- [OpenClawCompanion-Setup-arm64.exe](https://github.com/openclaw/openclaw-windows-node/releases/latest/download/OpenClawCompanion-Setup-arm64.exe)
41+
- [OpenClawCompanion-SHA256SUMS.txt](https://github.com/openclaw/openclaw-windows-node/releases/latest/download/OpenClawCompanion-SHA256SUMS.txt)
3842

3943
### Prerequisites
4044
- Windows 10 (20H2+) or Windows 11
@@ -54,6 +58,9 @@ Use the setup script to install or verify local Windows build prerequisites:
5458
# Check only; do not install packages or change git safe.directory
5559
.\scripts\setup-dev.ps1 -CheckOnly
5660
61+
# Install/verify prerequisites without adding the checkout to git safe.directory
62+
.\scripts\setup-dev.ps1 -NoTrustRepository
63+
5764
# Setup and run the required build/test validation
5865
.\scripts\setup-dev.ps1 -RunValidation
5966
```

build.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
Builds all projects, checks prerequisites, and provides clear guidance.
77
88
.PARAMETER Project
9-
Which project to build: All, Tray, WinUI, Shared, Cli
9+
Which project to build: All, Tray, WinUI, Shared, Cli, WinNodeCli, SetupEngine
1010
Default: All
1111
1212
.PARAMETER Configuration

docs/CONNECTION_ARCHITECTURE.md

Lines changed: 26 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -69,17 +69,21 @@ Inbound chat and agent timeline events must include the gateway's canonical `ses
6969
## Startup wiring (App.xaml.cs)
7070

7171
```
72-
1. Create GatewayRegistry(dataDir)
73-
2. Create CredentialResolver(identityReader)
74-
3. Create GatewayClientFactory()
75-
4. Create NodeConnector(logger)
76-
5. Create SshTunnelManager(tunnelService, logger)
77-
6. Create GatewayConnectionManager(resolver, factory, registry, ...,
78-
nodeConnector, tunnelManager)
79-
7. Subscribe to StateChanged → update tray icon + hub window
80-
8. Subscribe to OperatorClientChanged → wire/unwire 25+ data event handlers
81-
9. Subscribe to NodeConnector.ClientCreated → NodeService.AttachClient
82-
10. Call ConnectAsync() → connects to active gateway
72+
1. Create GatewayRegistry(SettingsManager.SettingsDirectoryPath)
73+
2. Load gateway registry from gateways.json
74+
3. Create CredentialResolver(DeviceIdentityFileReader.Instance)
75+
4. Create GatewayClientFactory()
76+
5. Create ConnectionDiagnostics()
77+
6. Create NodeConnector(logger, diagnostics)
78+
7. Wire NodeConnector.ClientCreated → NodeService.AttachClient
79+
8. Create SshTunnelService(logger)
80+
9. Create GatewayConnectionManager(resolver, factory, registry, logger,
81+
identityStore, nodeConnector, node mode flag,
82+
diagnostics, tunnelService)
83+
10. Subscribe to OperatorClientChanged → wire/unwire 25+ data event handlers
84+
11. Subscribe to StateChanged → update tray icon + hub window
85+
12. Ensure NodeService exists before gateway initialization
86+
13. Call InitializeGatewayClient() → connects to active gateway
8387
```
8488

8589
Settings changes are classified by `SettingsChangeClassifier.Classify()` which compares `ConnectionSettingsSnapshot` before/after to determine the minimum reconnect action:
@@ -126,7 +130,7 @@ Idle → Connecting → Connected
126130
%APPDATA%\OpenClawTray\gateways\<id>\device-key-ed25519.json — keypair + tokens
127131
```
128132

129-
Each `GatewayRecord` contains: `Id`, `Url`, `FriendlyName`, `SharedGatewayToken`, `BootstrapToken`, `LastConnected`, `SshTunnel` config, and an `IdentityDirName`.
133+
Each `GatewayRecord` contains: `Id`, `Url`, `FriendlyName`, `SharedGatewayToken`, `BootstrapToken`, `LastConnected`, `SshTunnel` config, `IsLocal`, `RequiresV2Signature`, `SetupManagedDistroName`, and `BrowserControlPort`. The `IdentityDirName` property is computed from `Id`.
130134

131135
`SettingsManager` still owns general tray settings (node mode, MCP mode, SSH tunnel toggles, notifications, UI preferences). It may read legacy `Token` / `BootstrapToken` JSON fields into memory for migration, but save must not write those legacy credential fields back.
132136

@@ -143,6 +147,13 @@ The invariant is that a paired device token always wins. Do not downgrade a pair
143147

144148
**`CredentialResolver`** implements the precedence for WebSocket connections (operator and node roles).
145149

150+
Node credential precedence follows the same invariant with a distinct stored token:
151+
152+
1. **Stored node device token** in the per-gateway identity directory.
153+
2. **`GatewayRecord.SharedGatewayToken`** — shared token fallback when no paired node token exists.
154+
3. **`GatewayRecord.BootstrapToken`** — one-time setup, limited scopes.
155+
4. **No credential** — caller logs and skips node client init.
156+
146157
**`InteractiveGatewayCredentialResolver`** resolves credentials for HTTP surfaces (chat URL `?token=` auth). It **prefers SharedGatewayToken** over DeviceToken because HTTP endpoints expect the shared token, not the per-device WebSocket token.
147158

148159
## Client instance lifecycle
@@ -176,7 +187,7 @@ When **another** device or node requests pairing, the gateway broadcasts `device
176187

177188
## SSH tunnel integration
178189

179-
`SshTunnelService` manages an SSH local port-forward process. `SshTunnelManager` wraps it behind `ISshTunnelManager` for the connection manager.
190+
`SshTunnelService` manages an SSH local port-forward process and implements `ISshTunnelManager` directly for the connection manager.
180191

181192
When a `GatewayRecord` has `SshTunnel` config, the connection manager starts the tunnel before connecting the WebSocket client to `ws://localhost:<localPort>`. The config stores the SSH daemon port (`sshPort`, default `22`) separately from the remote gateway port forwarded by `-L`.
182193

@@ -200,8 +211,9 @@ The `EnableMcpServer=true`, `EnableNodeMode=false` path creates a local-only `No
200211
Tray actions should never silently no-op on common pairing/configuration issues:
201212

202213
- Chat resolves credentials from the active registry record and per-gateway identity. If no usable credential exists, it opens Connection settings instead.
203-
- Canvas opens only when the Windows node is initialized and paired; otherwise it opens Connection settings.
214+
- Canvas opens only when the Windows node is initialized, paired, and the Canvas capability is enabled in settings; otherwise it opens Connection settings.
204215
- Quick Send uses the live operator client and surfaces scope/pairing errors from gateway calls.
216+
- `system.run` and `system.run.prepare` are gated by `NodeSystemRunEnabled` (default `true` for backward compatibility). When disabled, those commands are dropped from advertised capabilities and invocations are rejected.
205217

206218
## Legacy migration
207219

docs/MCP_MODE.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -100,12 +100,12 @@ public bool EnableNodeMode { get; set; } // open WebSocket to gateway
100100
public bool EnableMcpServer { get; set; } // run local MCP HTTP server
101101
```
102102

103-
| `EnableNodeMode` | `EnableMcpServer` | Result |
103+
| `EnableNodeMode` | `EnableMcpServer` | Behavior |
104104
|---|---|---|
105-
| off | off | Operator-only (legacy default) |
106-
| off | on | **MCP server only, no gateway** |
107-
| on | off | Gateway node, no MCP |
108-
| on | on | Gateway node + MCP |
105+
| false | false | Operator-only (legacy default) |
106+
| false | true | **MCP server only, no gateway** |
107+
| true | false | Gateway node, no MCP |
108+
| true | true | Gateway node + MCP |
109109

110110
Settings UI exposes both toggles in the Advanced section, with the live MCP endpoint URL and current status (`Listening` / `Stopped — save and restart to start` / `Disabled`).
111111

docs/SETUP.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@ Download the latest stable installer from the canonical OpenClaw release assets:
1919

2020
| File | Architecture |
2121
|------|-------------|
22-
| [OpenClawCompanion-Setup-x64.exe](https://github.com/openclaw/openclaw/releases/latest/download/OpenClawCompanion-Setup-x64.exe) | Intel / AMD (most PCs) |
23-
| [OpenClawCompanion-Setup-arm64.exe](https://github.com/openclaw/openclaw/releases/latest/download/OpenClawCompanion-Setup-arm64.exe) | ARM64 (Surface Pro X, Snapdragon laptops) |
24-
| [OpenClawCompanion-SHA256SUMS.txt](https://github.com/openclaw/openclaw/releases/latest/download/OpenClawCompanion-SHA256SUMS.txt) | SHA-256 checksums |
22+
| [OpenClawCompanion-Setup-x64.exe](https://github.com/openclaw/openclaw-windows-node/releases/latest/download/OpenClawCompanion-Setup-x64.exe) | Intel / AMD (most PCs) |
23+
| [OpenClawCompanion-Setup-arm64.exe](https://github.com/openclaw/openclaw-windows-node/releases/latest/download/OpenClawCompanion-Setup-arm64.exe) | ARM64 (Surface Pro X, Snapdragon laptops) |
24+
| [OpenClawCompanion-SHA256SUMS.txt](https://github.com/openclaw/openclaw-windows-node/releases/latest/download/OpenClawCompanion-SHA256SUMS.txt) | SHA-256 checksums |
2525

2626
If you're unsure, use the **x64** installer.
2727

@@ -188,7 +188,7 @@ Settings are stored at `%APPDATA%\OpenClawTray\settings.json`. If this file is c
188188

189189
## Updating
190190

191-
OpenClaw Companion checks for updates automatically and shows a notification when a new version is available. Click **Update** to download and apply the update. You can also manually check by re-downloading from the [OpenClaw Windows docs](https://docs.openclaw.ai/platforms/windows) or the [latest OpenClaw release](https://github.com/openclaw/openclaw/releases/latest).
191+
OpenClaw Companion checks for updates automatically and shows a notification when a new version is available. Click **Update** to download and apply the update. You can also manually check by re-downloading from the [OpenClaw Windows docs](https://docs.openclaw.ai/platforms/windows) or the [latest OpenClaw Windows release](https://github.com/openclaw/openclaw-windows-node/releases/latest).
192192

193193
## Uninstalling
194194

docs/TEST_COVERAGE.md

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Test Coverage Summary
22

3-
**Last audited**: 2026-05-22<br>
3+
**Last audited**: 2026-07-01<br>
44
**Framework**: xUnit / .NET 10.0<br>
55
**Required validation status**: passing (`.\build.ps1`, Shared tests, Tray tests)
66

@@ -11,23 +11,24 @@ These are the suites every agent must run after code changes, as documented in
1111

1212
| Suite | Latest runtime result |
1313
|---|---:|
14-
| `OpenClaw.Shared.Tests` | 1,920 total: 1,891 passed, 29 skipped |
15-
| `OpenClaw.Tray.Tests` | 1,178 total: 1,178 passed, 0 skipped |
14+
| `OpenClaw.Shared.Tests` | 2,720 total: 2,689 passed, 31 skipped |
15+
| `OpenClaw.Tray.Tests` | 1,452 total: 1,452 passed, 0 skipped |
1616

17-
Runtime totals come from `dotnet test` on 2026-05-22. They are higher than
17+
Runtime totals come from `dotnet test` on 2026-07-01. They are higher than
1818
method counts because some `[Theory]` tests expand into multiple cases.
1919

2020
## Test project inventory
2121

2222
| Project | Primary scope | Test methods |
2323
|---|---|---:|
24-
| `OpenClaw.Connection.Tests` | Gateway registry, credential resolution, connection manager/state machine, setup codes, pairing, diagnostics | 189 |
25-
| `OpenClaw.Shared.Tests` | Shared models, gateway client, capabilities, MCP, exec approval, A2UI security, URL handling, notification categorization | 1,347 |
26-
| `OpenClaw.Tray.Tests` | Tray state/UI helpers, settings isolation, onboarding, connection page behavior, localization, local gateway setup/uninstall | 786 |
27-
| `OpenClaw.Tray.UITests` | Native WinUI/A2UI control and rendering coverage | 50 |
28-
| `OpenClaw.WinNode.Cli.Tests` | Windows node CLI argument parsing, command behavior, JSON output, uninstall flow | 79 |
29-
| `OpenClawTray.FunctionalUI.Tests` | Functional UI smoke coverage | 8 |
30-
| `OpenClawTray.OnboardingV2.Tests` | Onboarding V2 page flow and state coverage | 9 |
24+
| `OpenClaw.Connection.Tests` | Gateway registry, credential resolution, connection manager/state machine, setup codes, pairing, diagnostics | 307 |
25+
| `OpenClaw.Shared.Tests` | Shared models, gateway client, capabilities, MCP, exec approval, A2UI security, URL handling, notification categorization | 1,932 |
26+
| `OpenClaw.Tray.Tests` | Tray state/UI helpers, settings isolation, onboarding, connection page behavior, localization, local gateway setup/uninstall | 1,131 |
27+
| `OpenClaw.Tray.UITests` | Native WinUI/A2UI control and rendering coverage | 61 |
28+
| `OpenClaw.WinNode.Cli.Tests` | Windows node CLI argument parsing, command behavior, JSON output, uninstall flow | 83 |
29+
| `OpenClaw.SetupEngine.Tests` | Setup engine, WSL gateway installation, setup-code, and local setup policy coverage | 244 |
30+
| `OpenClawTray.FunctionalUI.Tests` | Functional UI smoke coverage | 10 |
31+
| `OpenClaw.E2ETests` | Gateway-mediated setup/connect, revocation recovery, and network recovery suites | 0 |
3132
| `OpenClaw.Tray.IntegrationTests` | Integration-test project scaffold; no `[Fact]`/`[Theory]` methods currently | 0 |
3233

3334
The method inventory is a source scan of `[Fact]` and `[Theory]` attributes. Use
@@ -57,7 +58,9 @@ The method inventory is a source scan of `[Fact]` and `[Theory]` attributes. Use
5758
- **OpenClaw.Connection.Tests** keeps connection architecture tests separate from tray UI concerns.
5859
- **OpenClaw.Tray.UITests** covers A2UI/native WinUI rendering behavior that is awkward to validate through pure unit tests.
5960
- **OpenClaw.WinNode.Cli.Tests** covers the standalone Windows node CLI contract.
60-
- **OpenClawTray.OnboardingV2.Tests** and **OpenClawTray.FunctionalUI.Tests** cover newer UI surfaces outside the main tray test project.
61+
- **OpenClaw.SetupEngine.Tests** covers gateway setup and local WSL installation policy.
62+
- **OpenClawTray.FunctionalUI.Tests** covers newer UI surfaces outside the main tray test project.
63+
- **OpenClaw.E2ETests** is exercised by CI with trait filters even though the project currently has no direct `[Fact]`/`[Theory]` method inventory.
6164

6265
## Formal validation paths
6366

0 commit comments

Comments
 (0)