Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
60 commits
Select commit Hold shift + click to select a range
bd8ab21
fix(companion): require live Tailscale readiness for dashboard auth
CassieMei Aug 18, 2026
bac278a
fix(tray): centralize dashboard link policy
CassieMei Aug 19, 2026
1ebebfa
fix(tray): preserve bootstrap dashboard links
CassieMei Aug 21, 2026
b66e945
fix(connection): parse foreground tailscale serve status
CassieMei Aug 22, 2026
4006f6b
fix(connection): verify core-managed tailscale ingress
CassieMei Aug 22, 2026
b139798
fix(connection): stream WSL ownership probe via stdin
CassieMei Aug 22, 2026
0ad95b5
Merge upstream main into Tailscale legacy upgrade
CassieMei Aug 22, 2026
c8c7a95
Merge canonical main into PR 1128 repair branch
CassieMei Oct 10, 2026
2581f4b
test: reproduce credential-free saved dashboard rejection
CassieMei Oct 10, 2026
63e546f
fix: allow credential-free saved dashboard links
CassieMei Oct 10, 2026
8e487d7
test: align gateway assertions with rejection subtype
CassieMei Oct 10, 2026
5418659
test: update connection runner fakes and deadline
CassieMei Oct 10, 2026
40f9787
test: cover dashboard bearer fragments
CassieMei Oct 10, 2026
540dd90
fix: enforce dashboard token fragment policy
CassieMei Oct 10, 2026
6b1675c
fix: provide actionable Tailscale adoption recovery
TheAngryPit Oct 11, 2026
790a48d
Merge upstream main containment settings repair
TheAngryPit Oct 11, 2026
ff543be
test: separate handshake event readiness from timeout
TheAngryPit Oct 11, 2026
6484664
fix: require Core admin scope for configuration writes
TheAngryPit Oct 11, 2026
3c893ec
test: reproduce unapplied Tailscale configuration trust
CassieMei Oct 12, 2026
cd2e923
fix: require applied Core revision before Tailscale trust
CassieMei Oct 12, 2026
41c800e
fix: retain Tailscale auth outcome in sanitized diagnostics
TheAngryPit Oct 11, 2026
7dc1564
test: qualify missing diagnostic and expose handshake failures
CassieMei Oct 12, 2026
d98a0e1
fix: retain Tailscale Dashboard trust with inherited Node options
TheAngryPit Oct 13, 2026
82258a4
fix(connection): inspect privileged Serve ownership under root
CassieMei Oct 13, 2026
63adc63
fix: show dashboard retry guidance after link preparation failure
CassieMei Oct 14, 2026
02dba24
Merge 63adc635dd835b6fd5d66ca94cd005d5419847cd into 846ba0e9ddba96564…
TheAngryPit Oct 15, 2026
881c208
test: assert typed Gateway rejection in cron fixture
CassieMei Oct 15, 2026
89c0208
fix(tray): preserve localized dashboard launch failure
CassieMei Oct 15, 2026
5424204
fix(windows): address PR 1128 review findings
CassieMei Oct 15, 2026
095f439
fix(windows): update shared config fixture contract
CassieMei Oct 15, 2026
f9b58bf
fix(connection): require managed ingress for Tailscale dashboard auth
CassieMei Oct 18, 2026
44094c5
fix(connection): gate Tailscale auth and preserve upgrade retry
bkudiess Oct 20, 2026
3b49f7f
Merge main into Tailscale auth maintainer repair
bkudiess Oct 20, 2026
8cd9b08
Merge remote-tracking branch 'origin/main' into codex/pr1128-diagnost…
CassieMei Oct 20, 2026
454bb5d
test(shared): preserve typed rejection after main integration
bkudiess Oct 20, 2026
80c65a6
Merge updated contributor head into maintainer repair
bkudiess Oct 20, 2026
dd87f67
Merge current main after contributor reconciliation
bkudiess Oct 20, 2026
368584f
test(connection): avoid MSYS overhead in ownership fixtures
bkudiess Oct 20, 2026
857f74b
test: diagnose approval watcher and UI bootstrap failures
CassieMei Oct 20, 2026
54b7329
Merge latest contributor diagnostics before maintainer push
bkudiess Oct 20, 2026
93719d6
Merge pinned main and clarify Dashboard link ownership
TheAngryPit Oct 20, 2026
eb6b6e4
Merge maintainer fixture updates and align typed rejection assertions
TheAngryPit Oct 20, 2026
50ce3d6
test(ui): record OCR failure phase diagnostics
TheAngryPit Oct 21, 2026
2a55530
Merge pinned main and retain OCR diagnostics
TheAngryPit Oct 21, 2026
cef5d38
Merge main and preserve verified Tailscale dashboard handoff
TheAngryPit Oct 25, 2026
b0cabd5
merge: integrate current main into legacy Tailscale upgrade
TheAngryPit Oct 26, 2026
2acb461
Merge main and preserve definite Gateway request rejection
TheAngryPit Oct 28, 2026
1a09a01
Merge main into Tailscale upgrade branch
TheAngryPit Oct 30, 2026
3e68ea9
test: expect typed gateway rejections in fixtures
TheAngryPit Oct 30, 2026
b5d6954
Merge remote-tracking branch 'origin/main' into fix/pr1128-conflict-2…
TheAngryPit Oct 30, 2026
66f7d6b
Merge main and preserve managed Gateway upgrade authority
TheAngryPit Nov 12, 2026
a60d803
test: reveal paginated Usage rows and diagnose Systems bounds
TheAngryPit Nov 12, 2026
efe81dd
fix(connection): preserve managed gateway for equivalent root URLs
TheAngryPit Nov 12, 2026
e5cf253
Merge current main into Tailscale legacy upgrade
TheAngryPit Nov 13, 2026
19f586b
test: reconcile dashboard caller and timing guards with main
TheAngryPit Nov 13, 2026
1e8d771
test: wait for native attachment and isolate ownership probe deadline
TheAngryPit Nov 14, 2026
7388c55
Merge main and retain upstream native attachment readiness
TheAngryPit Nov 14, 2026
7676549
fix(connection): preserve native WSL probe time budgets
TheAngryPit Nov 14, 2026
2eb3439
test(connection): identify intentional probe latency
TheAngryPit Nov 14, 2026
ae660ef
Merge main and preserve approval wait diagnostics
TheAngryPit Nov 14, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .agents/skills/winnode/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -617,6 +617,11 @@ Build the same gateway dashboard URL the tray opens.
{"path": "string"} // optional
```
Returns `{ url, credentialSource, usesSharedGatewayToken, hasTokenQuery }`.
`credentialSource` is the selected credential's provenance, not proof it was
included in the URL. `usesSharedGatewayToken` reports actual browser credential
inclusion: false for verified Tailscale identity and bootstrap-only links, true
for shared-token fallback. Device/bootstrap credentials are not exported.
`hasTokenQuery` checks the query only; it does not describe a token fragment.

## App connection diagnostics and setup (app.connection.*)

Expand Down
2 changes: 2 additions & 0 deletions docs/ARCHITECTURE.md
Original file line number Diff line number Diff line change
Expand Up @@ -334,6 +334,7 @@ new attempt. This boundary does not change release signing or Windows policy.
| Desktop lobster quick-chat mounts and dedicated session identity | `DesktopCompanionChatHost` borrows the current app provider and owns separate retained dedicated/reply Reactor mounts, window-owned attachment picking and invocation-scoped voice-service callbacks. Notification replacement hides the mount and cancels capture without discarding its draft; late picker/capture results cannot cross hide or Gateway changes. `DesktopCompanionChatSessions` retains one confirmed or in-flight dedicated session per Gateway; closing a bubble does not repeat `sessions.create`. `ReactorChatHostExtensions` remains the shared mount owner and `OpenClawReactorChatRoot` supplies the compact layout. Chat notifications select their existing action-route session, never the main conversation as a fallback | authoritative |
| Gateway/operator/node status flyout controls | `GatewayStatusContent` | authoritative |
| Tray-menu semantic composition and connection-toggle state | `TrayMenuPresenter` + `ConnectionTogglePresenter` | authoritative |
| Dashboard link Tailscale revalidation, browser-credential fallback, and fail-closed URL policy | `GatewayDashboardLinkService` (Tailscale revalidation and fallback decisions) + `GatewayDashboardUrlBuilder` (URL scheme and token-fragment policy) | authoritative |
| App-owned non-tray window creation, reuse, focus, theme, and lifetime | `IWindowManager` + `WindowManager`; Workspace is the only application chat host, and the never-activated runtime anchor stays hidden without shell switcher registration | authoritative |
| Standalone compact chat hosting and prewarming | Removed; chat entry points use Workspace, with no hidden replacement window during background startup | closed |
| Composer session picker and compact-host layout mode | Removed, including the picker-only `IsVisibleInChatPicker` helper; non-picker session filters remain. Workspace owns session selection, while actual-width observation retains responsive model/reasoning controls and transcript geometry | closed |
Expand Down Expand Up @@ -1041,6 +1042,7 @@ leading and trailing pipe. Columns, in order:
| app-window-surface-ownership-closed | closed | src/OpenClaw.Tray.WinUI/App.xaml.cs | concrete non-tray window fields, constructors, show/hide/focus/theme/close mechanics, and window event lifetime | IWindowManager + WindowManager | interface forwarding, immutable request construction, route and policy callbacks, and setup restart dialog policy only | App cannot regain a parallel Settings, Workspace, status, setup, canvas-request, or runtime-anchor owner, nor revive the retired chat popup | AppSurfaceOwnershipContractTests.App_DelegatesConcreteTrayAndWindowOwnership | source-shape | when App is replaced as the WinUI composition root |
| app-tray-controller | authoritative | src/OpenClaw.Tray.WinUI/App.xaml.cs | tray icon creation, tray popup coordination, click routing, tooltip and live-toggle refresh, theme, callbacks, and disposal | ITrayController + TrayController | App captures immutable snapshots, implements semantic action callbacks, triggers refresh from authoritative state, preserves startup construction order, and constructs shutdown-plan callbacks | one tray icon and root menu are reused; A1 presenters retain semantics; TrayMenuWindow retains native popup mechanics; callbacks detach and resources dispose once | TrayControllerTests.Dispose_UnsubscribesAndDisposesEachResourceOnce | source-shape | when the WinUI tray surface is replaced |
| app-tray-surface-ownership-closed | closed | src/OpenClaw.Tray.WinUI/App.xaml.cs | concrete tray icon, root menu, weak live-control state, event subscriptions, popup build coordination, and resource disposal | ITrayController + TrayController | immutable snapshot and action callbacks plus state-change triggers only | App cannot regain tray controls or popup lifetime and TrayController cannot duplicate A1 semantic projection or TrayMenuWindow native mechanics | AppSurfaceOwnershipContractTests.App_DelegatesConcreteTrayAndWindowOwnership | source-shape | when the WinUI tray surface is replaced |
| dashboard-link-policy | authoritative | src/OpenClaw.Tray.WinUI/App.xaml.cs + App.CapabilityHandlers.cs + Pages/ConnectionPage.xaml.cs | duplicated Tailscale revalidation and browser-credential fallback decisions, plus dashboard URL scheme and token-fragment policy | GatewayDashboardLinkService (Tailscale revalidation and fallback decisions) + GatewayDashboardUrlBuilder (URL scheme validation and token-fragment construction) | callers retain UI launch, error, provenance, and MCP response side effects | trusted Tailscale links omit shared credentials; degraded Tailscale revalidation falls back only to an approved shared browser credential and otherwise fails closed; non-Tailscale QR/bootstrap requests preserve the existing token-free dashboard URL | AppRefactorContractTests.DashboardLinkPolicy_StaysDelegatedToFocusedService | source-shape | when App, ConnectionPage, and local MCP no longer own dashboard-link entrypoints |
| native-tool-projector | authoritative | src/OpenClaw.Tray.WinUI/Chat/OpenClawChatDataProvider.cs | pure native tool identity, allowlisted summaries, bounded redacted structured details, payload extraction, and flattened-history detection/classification/summary | NativeToolProjector | ChatEventMapper and ChatHistoryLoader call the projector; ChatConversationState supplies scoped correlation plans and ChatMetadataStore owns persistence | unknown identities remain truthful Tool; title aliases are strict; preview limits do not truncate the separately bounded full-detail projection; yield continuation input stays suppressed; live/history projection stays consistent | NativeToolProjectorTests.ExtractToolIdentity_TitleRequiresExactTrustedAlias | behavioral | - |
| provider-native-tool-projection-closed | closed | src/OpenClaw.Tray.WinUI/Chat/OpenClawChatDataProvider.cs | private static copies of native tool identity, display argument, payload, flattened-history projection, and scoped metadata upsert | NativeToolProjector + ChatEventMapper + ChatHistoryLoader + ChatConversationState + ChatMetadataStore | provider forwards typed tool metadata writes while retaining bridge IO, telemetry, and event publication only | provider does not regain native tool JSON projection, identity policy, timeline correlation, or metadata persistence | review-only: pure projection, atomic correlation, and persistence are delegated to focused owners while the provider remains the IO facade | review-only | when OpenClawChatDataProvider is retired |
| chat-conversation-state | authoritative | src/OpenClaw.Tray.WinUI/Chat/OpenClawChatDataProvider.cs | provider-owned runtime gate and cross-domain state transactions | ChatConversationState | sole lock, timeline and entry metadata, connection/disposal flags, and typed orchestration across lock-free substates; provider supplies bridge context and coordinates IO, telemetry, and events | one authoritative lock atomically commits reset, reconnect, dispose, queue, history, and event transitions without duplicate shared versions | ChatRuntimeOwnershipContractTests.Root_CoordinatesCrossDomainCommitsUnderSoleGate | source-shape | when the chat runtime is replaced by a different atomic transaction boundary |
Expand Down
18 changes: 18 additions & 0 deletions docs/CONNECTION_ARCHITECTURE.md
Original file line number Diff line number Diff line change
Expand Up @@ -824,6 +824,24 @@ Many gateway records may be saved, but only `ActiveId` in `gateways.json` is the

## Credential precedence

### Tailscale dashboard auth upgrade

`GatewayConnectionManager` serializes enablement and dashboard revalidation with
gateway transitions. Both use `GatewayTailscaleAuthUpgradeService` and the same
live ingress verifier. Enablement requires Core-managed foreground Serve before
dispatching the hash-conditional auth-only patch. It records new trust only after
confirmed patch acceptance, not before dispatch or after an unknown outcome.
The marker is not a readiness claim. `GatewayDashboardLinkService` still verifies
applied config and live ingress before omitting a browser credential. See the
[supported topology and retry contract](WSL_GATEWAY_ADMIN.md#upgrade-dashboard-authentication-on-an-existing-gateway).

`app.dashboard.url` retains the selected credential's `credentialSource` as
provenance, while `usesSharedGatewayToken` reports the emitted link's
`BrowserCredentialIncluded`. Verified Tailscale identity can therefore report a
shared-token source with `usesSharedGatewayToken=false`. Shared fallback reports
true; bootstrap-only links retain bootstrap provenance without exporting that
credential. `hasTokenQuery` describes the query only, not a token in the fragment.

### Native onboarding connection boundary

`SetupNativeConnectionPage` retains an immutable `SetupNativeConnectionRequest`.
Expand Down
35 changes: 34 additions & 1 deletion docs/WSL_GATEWAY_ADMIN.md
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,40 @@ wsl.exe -d OpenClawGateway --user openclaw -- bash -lc "systemctl --user status

The generated WSL distro is Ubuntu 24.04 (noble). Tailscale Serve setup requires that exact generated distro and rejects another `BaseDistro` before replacing an existing gateway. Setup installs Tailscale from its signed stable APT repository rather than executing the mutable `install.sh` bootstrap script as root.

Tailscale Serve preserves Companion token and device authentication by default (`gateway.auth.allowTailscale=false`). Setup runs `tailscale up`, Serve, reset, logout, and daemon management as root; the `openclaw` account is never made a Tailscale operator. Tailscale's LocalAPI permits read-only operations, such as identity lookup, to local unprivileged clients while reserving mutation for root or an explicitly configured operator. In the setup review, **Trust Tailscale identities for gateway authentication** is an explicit opt-in; when enabled, verified Tailscale identity headers and tailnet ACLs become part of the gateway access-control boundary. Token and device credentials remain available for Companion pairing and compatibility. Do not enable Funnel for this generated gateway: this workflow supports private tailnet Serve only.
Tailscale Serve preserves Companion token and device authentication by default (`gateway.auth.allowTailscale=false`). Setup runs `tailscale up`, Serve, reset, logout, and daemon management as root; the `openclaw` account is never made a Tailscale operator. Tailscale's LocalAPI permits read-only operations, such as identity lookup, to local unprivileged clients while reserving mutation for root or an explicitly configured operator. In the setup review, **Trust Tailscale identities for gateway authentication** is an explicit opt-in that writes the auth setting and records consent. Consent alone does not establish working identity authentication: the setup-generated background Serve route is not Core-managed identity ingress. Token and device credentials remain available for Companion pairing and compatibility. Do not enable Funnel for this generated gateway: this workflow supports private tailnet Serve only.

### Upgrade dashboard authentication on an existing gateway

In Connection, select the managed Tailscale gateway, connect with
`operator.admin`, then choose **Use Tailscale identity for dashboard** from its
saved-row menu and confirm. This auth-only action requires
`gateway.tailscale.mode="serve"` and verified Core-owned foreground Serve ingress.
It reads configuration and checks ingress before changing either Core or local
trust. Missing or unavailable ingress returns a not-ready message.

The default setup topology has `gateway.tailscale.mode="off"` and root-owned
`tailscale serve --bg`. It is unsupported by this action, even if Serve forwards
HTTPS successfully. Ask the gateway administrator to review the installed Core
version and deployment. The action does not migrate the distro, switch Serve
ownership, restart services, or change token/device credentials. Do not toggle
the mode alone and assume that proves compatible ingress.

On supported ingress, the action sends only
`{"gateway":{"auth":{"allowTailscale":true}}}` with the fresh Core config hash.
A new local `TrustTailscaleAuth` marker is saved only after Core confirms patch
acceptance. The success message reports acceptance, not completed asynchronous
application. Dashboard links separately verify matching applied configuration
and live ingress before omitting the browser token.

A rejected, timed-out, lost, or canceled response does not create new trust.
Reconnect and repeat the same action; it remains available after registry reload,
and its minimal patch is idempotent even if Core accepted the earlier request.
Cancellation during dispatch waits for the bounded request to finish before
returning, without saving new trust. A local save failure restores the in-memory
marker and leaves the same retry available. Existing true consent is preserved
on ambiguous failures; only authoritative applied config revocation clears it.
When live identity cannot be verified, links use an independently approved shared
browser credential or fail closed if none is available.

## Use root instead of sudo

Expand Down
73 changes: 73 additions & 0 deletions src/OpenClaw.Connection/GatewayConnectionManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ public sealed class GatewayConnectionManager :
private readonly ICredentialResolver _credentialResolver;
private readonly IGatewayClientFactory _clientFactory;
private readonly GatewayRegistry _registry;
private readonly IGatewayTailscaleAuthLiveVerifier _tailscaleAuthLiveVerifier;
private readonly IOpenClawLogger _logger;
private readonly INativeGatewayRuntime? _nativeGatewayRuntime;
private GatewayRecord? _nativeGatewayRecord;
Expand Down Expand Up @@ -142,6 +143,8 @@ public GatewayConnectionManager(
_clientFactory = clientFactory ?? throw new ArgumentNullException(nameof(clientFactory));
_registry = registry ?? throw new ArgumentNullException(nameof(registry));
_logger = logger ?? throw new ArgumentNullException(nameof(logger));
_tailscaleAuthLiveVerifier = new GatewayTailscaleAuthLiveVerifier(
new WslExeCommandRunner(_logger));
_nativeGatewayRuntime = nativeGatewayRuntime;
_identityStore = identityStore;
_nodeConnector = nodeConnector;
Expand Down Expand Up @@ -216,6 +219,76 @@ public GatewayConnectionManager(
public IOperatorGatewayClient? OperatorClient => _activeLifecycle?.DataClient;
/// <summary>Internal access to the concrete client for auto-approve and other manager-internal operations.</summary>
internal OpenClawGatewayClient? ConcreteOperatorClient => _activeLifecycle?.DataClient;

public async Task<GatewayTailscaleAuthUpgradeResult> EnableTailscaleDashboardAuthAsync(
string gatewayId,
CancellationToken cancellationToken = default)
{
await _transitionSemaphore.WaitAsync(cancellationToken).ConfigureAwait(false);
try
{
GatewayTailscaleAuthUpgradeResult result;
var client = OperatorClient;
if (!string.Equals(_activeGatewayRecordId, gatewayId, StringComparison.Ordinal))
{
result = new(GatewayTailscaleAuthUpgradeOutcome.NotActive);
}
else if (client is null)
{
result = new(GatewayTailscaleAuthUpgradeOutcome.NotConnected);
}
else
{
var service = new GatewayTailscaleAuthUpgradeService(
_registry,
_tailscaleAuthLiveVerifier);
result = await service.EnableAsync(
gatewayId,
new GatewayTailscaleAuthConfigClientAdapter(client),
cancellationToken)
.ConfigureAwait(false);
}

_diagnostics.Record(
"tailscale-auth",
$"Dashboard auth upgrade: {result.Outcome}",
result.Error);
return result;
}
finally
{
_transitionSemaphore.Release();
}
}

public async Task<bool> RevalidateTailscaleDashboardAuthAsync(
string gatewayId,
CancellationToken cancellationToken = default)
{
await _transitionSemaphore.WaitAsync(cancellationToken).ConfigureAwait(false);
try
{
if (!string.Equals(_activeGatewayRecordId, gatewayId, StringComparison.Ordinal))
return false;

var client = OperatorClient;
if (client is null)
return false;

var service = new GatewayTailscaleAuthUpgradeService(
_registry,
_tailscaleAuthLiveVerifier);
return await service.RevalidateAsync(
gatewayId,
new GatewayTailscaleAuthConfigClientAdapter(client),
cancellationToken)
.ConfigureAwait(false);
}
finally
{
_transitionSemaphore.Release();
}
}
public ConnectionDiagnostics Diagnostics => _diagnostics;

internal async Task<OpenClawGatewayClient> RequireNativeSetupClientAsync(
Expand Down
8 changes: 8 additions & 0 deletions src/OpenClaw.Connection/GatewayRecord.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,12 @@ public sealed record GatewayRecord
/// <summary>WSL distro name for gateway records provisioned by SetupEngine.</summary>
public string? SetupManagedDistroName { get; init; }

/// <summary>
/// Explicit setup consent or a confirmed, accepted auth upgrade for this managed
/// gateway. Dashboard access still requires applied config and live ingress verification.
/// </summary>
public bool TrustTailscaleAuth { get; init; }

/// <summary>
/// Installed MSIX package family owned by the native gateway runtime. Native gateways
/// are non-isolated and must never also carry a setup-managed WSL distro marker.
Expand Down Expand Up @@ -121,6 +127,7 @@ rebuilt.SshTunnel is null &&
// Migrate legacy "Local (<distro>)" ownership to the explicit durable marker.
SetupManagedDistroName = managedDistroName,
RequiresV2Signature = rebuilt.RequiresV2Signature || existing.RequiresV2Signature,
TrustTailscaleAuth = rebuilt.TrustTailscaleAuth || existing.TrustTailscaleAuth,
};
}
else if (existingManagedDistroName is not null)
Expand All @@ -130,6 +137,7 @@ rebuilt.SshTunnel is null &&
IsLocal = OpenClaw.Shared.LocalGatewayUrlClassifier.IsLocalGatewayUrl(rebuilt.Url),
SetupManagedDistroName = null,
RequiresV2Signature = false,
TrustTailscaleAuth = false,
FriendlyName = ParseLegacyManagedDistroName(result.FriendlyName) is not null
? null
: result.FriendlyName,
Expand Down
Loading
Loading