You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Keep PR 918 current with main and add a maintainer patch so app.settings.set surfaces MCP startup failures as tool errors while MCP startup notifications are shown or dismissed from a single runtime policy.
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copy file name to clipboardExpand all lines: AGENTS.md
+2Lines changed: 2 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -13,6 +13,8 @@ Required steps:
13
13
3. Run tray tests:
14
14
-`dotnet test ./tests/OpenClaw.Tray.Tests/OpenClaw.Tray.Tests.csproj --no-restore`
15
15
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.
|**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 |
25
27
|**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 |
26
30
27
31
## 🚀 Quick Start
28
32
29
33
> **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).
30
34
>
31
35
> **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.
36
+
>
37
+
> **Operator or node?** Start with [Operator and node concepts](docs/OPERATOR_NODE_CONCEPTS.md) for the beginner-facing glossary of gateway, operator, node, pairing, reapproval, and allowlisted node capabilities.
32
38
33
-
Direct downloads from the latest OpenClaw release:
39
+
Direct downloads from the latest OpenClaw Windows release:
12. Ensure NodeService exists before gateway initialization
86
+
13. Call InitializeGatewayClient() → connects to active gateway
83
87
```
84
88
85
89
Settings changes are classified by `SettingsChangeClassifier.Classify()` which compares `ConnectionSettingsSnapshot` before/after to determine the minimum reconnect action:
Each `GatewayRecord` contains: `Id`, `Url`, `FriendlyName`, `SharedGatewayToken`, `BootstrapToken`, `LastConnected`, `SshTunnel` config, and an `IdentityDirName`.
136
+
Each `GatewayRecord` contains: `Id`, `Url`, `FriendlyName`, `SharedGatewayToken`, `BootstrapToken`, `LastConnected`, `SshTunnel` config, `IsLocal`, `RequiresV2Signature`, `SetupManagedDistroName`, and `BrowserControlPort`. The `IdentityDirName` property is computed from `Id`.
133
137
134
138
`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.
135
139
@@ -146,6 +150,13 @@ The invariant is that a paired device token always wins. Do not downgrade a pair
146
150
147
151
**`CredentialResolver`** implements the precedence for WebSocket connections (operator and node roles).
148
152
153
+
Node credential precedence follows the same invariant with a distinct stored token:
154
+
155
+
1.**Stored node device token** in the per-gateway identity directory.
156
+
2.**`GatewayRecord.SharedGatewayToken`** — shared token fallback when no paired node token exists.
4.**No credential** — caller logs and skips node client init.
159
+
149
160
**`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.
150
161
151
162
## Client instance lifecycle
@@ -179,7 +190,7 @@ When **another** device or node requests pairing, the gateway broadcasts `device
179
190
180
191
## SSH tunnel integration
181
192
182
-
`SshTunnelService` manages an SSH local port-forward process. `SshTunnelManager` wraps it behind `ISshTunnelManager` for the connection manager.
193
+
`SshTunnelService` manages an SSH local port-forward process and implements `ISshTunnelManager` directly for the connection manager.
183
194
184
195
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`.
185
196
@@ -203,8 +214,9 @@ The `EnableMcpServer=true`, `EnableNodeMode=false` path creates a local-only `No
203
214
Tray actions should never silently no-op on common pairing/configuration issues:
204
215
205
216
- Chat resolves credentials from the active registry record and per-gateway identity. If no usable credential exists, it opens Connection settings instead.
206
-
- Canvas opens only when the Windows node is initializedand paired; otherwise it opens Connection settings.
217
+
- Canvas opens only when the Windows node is initialized, paired, and the Canvas capability is enabled in settings; otherwise it opens Connection settings.
207
218
- Quick Send uses the live operator client and surfaces scope/pairing errors from gateway calls.
219
+
-`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.
Copy file name to clipboardExpand all lines: docs/MCP_MODE.md
+5-5Lines changed: 5 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -100,12 +100,12 @@ public bool EnableNodeMode { get; set; } // open WebSocket to gateway
100
100
publicboolEnableMcpServer { get; set; } // run local MCP HTTP server
101
101
```
102
102
103
-
|`EnableNodeMode`|`EnableMcpServer`|Result|
103
+
|`EnableNodeMode`|`EnableMcpServer`|Behavior|
104
104
|---|---|---|
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 |
109
109
110
110
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`).
OpenClaw Companion connects a Windows PC to an OpenClaw gateway in two separate
4
+
roles. A new install can use both roles at once, but they have different jobs and
5
+
different approval paths.
6
+
7
+
## Quick Glossary
8
+
9
+
| Term | Meaning |
10
+
| --- | --- |
11
+
| Gateway | The OpenClaw service that coordinates agents, channels, sessions, devices, and nodes. The Windows app talks to it over WebSocket. |
12
+
| Local WSL gateway | A dedicated `OpenClawGateway` WSL distro installed by the Windows onboarding flow. It is app-owned and locked down rather than a general-purpose Ubuntu profile. |
13
+
| Operator | The user-facing control role. The tray app uses the operator connection for Quick Send, chat, diagnostics, channel controls, setup, and approving pairing requests. |
14
+
| Node | The controllable Windows machine role. When Node Mode is enabled, the tray app advertises Windows capabilities such as screenshots, canvas, camera, notifications, and approved command execution. |
15
+
| Pairing | The gateway approval flow that turns a new device or node request into a trusted identity with a stored device token. |
16
+
| Reapproval | A later approval request when a paired node asks for new or changed trust, such as command capability access. |
17
+
| Allowlisted node capability | A node command the gateway is explicitly allowed to invoke, configured in the gateway `allowCommands` list. Windows-side settings and policies can still block the command. |
18
+
19
+
## How the Roles Work Together
20
+
21
+
The operator role is the control surface. It signs in to the gateway, sends chat
22
+
messages, shows status, opens diagnostics, and approves device or node pairing
23
+
requests when the gateway says approval is required.
24
+
25
+
The node role is the Windows capability surface. It tells the gateway which
26
+
Windows-native tools are available, then waits for approved gateway calls. Node
27
+
Mode does not mean every tool can run automatically. A capability has to be
28
+
enabled in Windows settings, allowed by the gateway, and in some cases approved
29
+
by a local Windows policy prompt.
30
+
31
+
A typical local setup uses this sequence:
32
+
33
+
1. OpenClaw Companion installs or connects to a gateway.
34
+
2. The tray app connects as an operator so you can send messages and manage setup.
35
+
3. If Node Mode is enabled, the same Windows app also connects as a node.
36
+
4. The gateway asks for pairing approval before trusting the new device or node.
37
+
5. After approval, the gateway can invoke only the node capabilities that are
38
+
enabled locally and allowlisted by gateway policy.
39
+
40
+
## Local WSL Gateway Versus Existing Gateway
41
+
42
+
The default onboarding path installs a local WSL gateway for users who do not
43
+
already have one. That gateway runs on the same Windows PC and is managed by the
44
+
OpenClaw Companion setup flow.
45
+
46
+
Advanced setup is for users who already have a local, remote, or manually
47
+
managed gateway. In that case, the Windows app still uses the same operator and
48
+
node roles; only the gateway location and credentials are different.
49
+
50
+
## Pairing, Tokens, and Reapproval
51
+
52
+
Pairing is gateway-owned. Setup codes, bootstrap tokens, and shared gateway
53
+
tokens can help the app connect for the first time, but a paired device token
54
+
takes precedence after approval. This keeps long-lived operator and node
55
+
identity scoped to the gateway record that issued it.
56
+
57
+
Some trust decisions are intentionally not automatic. Node command trust and
58
+
capability reapproval stay pending until an operator explicitly approves them,
59
+
so a new or changed node capability is visible before the gateway can use it.
60
+
61
+
## Capability Allowlist
62
+
63
+
Node Mode advertises available Windows commands, but the gateway decides which
64
+
commands it may call through `gateway.nodes.allowCommands` in
65
+
`~/.openclaw/openclaw.json`. Add exact command names such as `screen.snapshot`,
66
+
`canvas.present`, or `system.run`; wildcard entries are not expanded by the
67
+
gateway.
68
+
69
+
Privacy-sensitive commands, especially `screen.record`, `camera.snap`,
70
+
`camera.clip`, `stt.transcribe`, `tts.speak`, and `system.run`, should only be
71
+
allowlisted when you want the gateway to be able to request that behavior.
72
+
Windows permissions, Node Mode toggles, and the local exec policy can still add
73
+
stricter checks.
74
+
75
+
## Where to Go Next
76
+
77
+
- Follow [Installation and setup](SETUP.md) for first-run onboarding and
78
+
troubleshooting.
79
+
- See [Node Mode](../README.md#-node-mode-agent-control) for capability names
80
+
and allowlist examples.
81
+
- Read [Connection architecture](CONNECTION_ARCHITECTURE.md) for contributor
82
+
details about token precedence, pairing, and connection lifecycle.
0 commit comments