feat: upgrade legacy managed Gateways to Tailscale auth #1128
All Vouch review confidence checks passed
Residual risk 0.48 = Change Risk (0.82) × (1 − Review Confidence (0.42)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.82 · 650 lines diff across 8 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.02 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.388
Shallow Review Depth
shallow_review_depth
0.344
Sensitive Paths
sensitive_paths
0.082
Real PR Conversation Timeline
1 comments
"Review active on #1128"
general
weight: 0.35
RomneyDa
<!--
Optional linked context:
Add a visible
Closes #<issue-number>orRelated: #<issue-number>linebelow this comment.
Required PR title:
type: user-facing description
Use a parenthesized scope only when it adds clarity:
fix(auth): login redirect loops when session cookie is expired
Types: feat, fix, improve, refactor, docs, chore.
For fixes, describe the user-visible symptom and trigger:
fix: task list fails to load when user has no environments
Avoid implementation details such as:
fix: add null check to task query
MUST: Keep Allow edits from maintainers enabled for this PR so maintainers
can help update the branch when needed.
-->
Related: #1117. Separate from #1989. Maintainer proof requirements.
What Problem This Solves
<!--
Describe the concrete user, product, or operational problem.
Use one short, plain-language sentence. For fixes, prefer:
"Fixes: <what goes wrong> when <trigger or condition>."
For other changes, describe the need without inventing a bug.
Name the affected workflow, not the code-level cause.
-->
Existing Companion-managed WSL Gateways lack a supported in-place action to adopt Tailscale Dashboard authentication while preserving existing shared access.
User Impact
<!--
"User impact: <what users, operators, or developers can now do or expect>."
Lead with the concrete outcome in plain language, usually one sentence.
For internal-only changes, say there is no user-visible change; do not invent a benefit.
Keep important risks, breaking changes, migrations, and required user actions visible here.
-->
Operators can explicitly enable Core-verified Tailscale Dashboard authentication for eligible legacy managed Gateways. Existing credentials remain intact. This action supports Gateway-managed foreground Serve; it does not convert Setup background-Serve deployments or perform automatic migration. Real lab opt-in, local-persistence failure/retry and fixture-backed selective revocation are demonstrated below. Previous-version upgrade, complete proof-pool qualification and maintainer acceptance remain open.
Why This Change Was Made
<!--
Briefly explain how the change addresses the problem without repeating the impact.
Keep the body short. Leave file lists, internal acronyms, and root-cause walkthroughs
in the diff or optional <details>; include technical detail only when it explains
behavior or a material tradeoff. Do not hide risks or required actions in <details>.
-->
The upgrade captures the authenticated connection epoch before reading config, requires the existing admin scope and authoritative base hash, then patches only
gateway.auth.allowTailscale. Replacement connections cannot receive a patch captured for the old connection. Core patch acceptance permits saving local trust; it does not prove asynchronous apply or continued ingress readiness. Dashboard link creation revalidates current config/applied state and managed ingress before a token-free launch.Saved links validate the credential/export requirements for that link, and setup authority is checked immediately before browser dispatch after asynchronous validation. An independently approved browser credential remains an intentional fallback for this upgrade flow. Personal-mode no-fallback selection is the separate #1989 contract.
Evidence
<!--
Show the most useful proof that this change works. Screenshots, screencasts,
terminal output, focused tests, CI results, live observations, redacted logs,
and artifact links are all useful. Include before/after evidence for visual
changes when it clarifies the result.
Reviewers will inspect the code, tests, and CI. Use this section to make the
validation easy to understand, not to restate the diff.
Summarize what was checked and the result; note meaningful gaps. Link long output
or put it in optional <details>, keeping the useful evidence summary visible.
-->
Real Windows/WSL/browser qualification was collected on 14 November 2026. It now includes normal native opt-in from false/false, token-free authenticated browser access, accepted-config/local-save failure followed by retry, selective application-grant denial, retirement of an admitted browser with code 4001, denied reconnect, and independent valid authentication. Details and limitations are below.
Current source and the native proof binary are both
ae660ef0e692d5dacb7a642cc026bd534560d8df, integrating frozen main34e8b609. All three runtime scenarios were repeated on this exact head. Current-head Build and Test and CodeQL passed; complete proof-pool acceptance remains open. No merge readiness is claimed.Change Type
Scope
winnodeRequired proof pools
<!--
Select every applicable pool ID from docs/PROOF_POOLS.md using:
<pool-id>: <reason>Use
nonewith a reason only when no capacity-dependent custom Windows proof isrequired. Declaring a pool schedules proof; it does not claim the proof ran.
-->
windows-wsl-gateway-e2e: Partially qualified in operation. The three requested lab scenarios have real Gateway/browser evidence below. The grant policy is fixture-backed. A previous-version installer/data upgrade and the complete pool are not claimed.windows-winui-interactive: Partially qualified in operation. Mounted native Connection menu opt-in, failure/retry and normal Dashboard browser dispatch ran. Remaining full UI/distribution obligations and current CI are separate.Validation
<!--
Include exact commands and pass/fail counts. Baseline after code changes:
./build.ps1dotnet test ./tests/OpenClaw.Shared.Tests/OpenClaw.Shared.Tests.csproj --no-restoredotnet test ./tests/OpenClaw.Tray.Tests/OpenClaw.Tray.Tests.csproj --no-restoreAdd focused tests when relevant. In fresh worktrees, confirm tests actually ran
and report non-zero test counts.
For inventory-bound proof, link the local execution summary described in
docs/PROOF_POOLS.md. A valid summary is not complete pool, visual, or binary-provenance proof.
-->
./build.ps1 -Project All -Configuration Debug -NoTrustRepository: all five targets passed on native Windows x64, sourceae660ef0.dotnet test tests/OpenClaw.Connection.Tests/OpenClaw.Connection.Tests.csproj --no-restore --filter 'FullyQualifiedName~GatewayTailscaleAuthLiveVerifierTests|FullyQualifiedName~GatewayTailscaleAuthUpgradeTests': 156 passed, zero failures/skips. The new healthy-slow-probe regression failed before repair, then passed after it../scripts/validate-test-timing-patterns.ps1: passed after marking the intentional latency with the repository's required timing directive. No baseline increase.dotnet test tests/OpenClaw.Tray.Tests/OpenClaw.Tray.Tests.csproj --no-restore --filter FullyQualifiedName~TestDeterminismGuardTests: 38 passed, zero failures/skips after that directive.ae660ef0, 235 focused Connection cases, all 6,712 Tray cases and 557 focused approval/client cases passed. Full Shared had 5,871 passes, 30 skips and 12 explicit missing-symbolic-link-privilege failures; those failures were not hidden. Scoped Autoreview, NoComments and independent Astra reviewed the manual conflict resolution.Real Behavior Proof
<!--
Paste at least one current-head proof item that directly demonstrates the
changed behavior. Use copied live output, screenshots or video, UI diagnostics,
winnodeoutput, raw MCP JSON-RPC, gateway invoke output, redacted runtimelogs, or linked artifacts.
-->
Published and freshly built source:
ae660ef0e692d5dacb7a642cc026bd534560d8df, integrating pinned main34e8b6099f4cbf225c4247fa814e4823dd75c9d2. Native executable SHA-256:102D56749223CFA6CA19B5365198C5AC34919A21A62610801A743BF457DF8A33. Native opt-in, failure/retry, normal browser dispatch, protected access/reload and selective revocation were repeated with this binary. Earlier results for7676549c/2eb34396remain historical records.Environment: Windows x64 Companion, a separate task-owned Ubuntu WSL Gateway running official OpenClaw
2026.11.3 (847611d), Tailscale1.104.7, and genuine Gateway-owned foreground Serve on HTTPS 443. The saved legacy record and device were synthetic; the running Gateway, pairing, configuration transaction and browser were real. This is not a previous-version installer/upgrade proof. No model-provider credentials or private conversations were copied.| Scenario | Actual observed result |
|---|---|
| Existing record, client trust false and Core
allowTailscale=false| Clean browser reached the Gateway but required a matching secret. Normal native Connection menu opt-in then received Core acceptance, persisted local trust and retained the original record/device. || Token-free Dashboard | Generated HTTPS URL had no token query/fragment. A clean browser connected with
hello.auth.method=tailscaleand successfully requestedagents.list. The normal mounted Connection Dashboard button, with external-browser suppression disabled, also opened a new default-Chrome tab which authenticated through Tailscale and successfully requestedagents.list. Reload retained authenticated access. || Accepted patch, failed local persistence | A temporary read-sharing lock on the synthetic registry prevented atomic persistence. UI reported that local trust could not be saved. Authoritative Core readback was true while persisted client trust was false. No rollback was claimed. After releasing the lock, the old device reconnected Ready and the normal retry persisted trust in the same record. No permission changes were used. |
| Selective person denial and live revocation | A task-only plugin used Core's supported Gateway access-policy API. Its admin-scoped fixture method persisted revocation and aborted real captured grant signals; it did not close sockets or synthesize authorization failures. Core closed the admitted browser with code
4001. A subsequent protected request failed because that connection was retired, and fresh handshakes were denied atauth_validatedwith causeoperator-access-denied. Serve remained reachable and independent pre-existing synthetic token/device authentication successfully fetched Gateway health over the same real WSS endpoint. || Fixture mutation authority | A real shipped Core client admitted with only
operator.readreceivedFORBIDDEN: missing scope: operator.adminwhen invoking the fixture's revoke method. Repeating an authorized revocation reported zero newly aborted leases. || Restoration | Restoring only the test grant with a new lifetime permitted a fresh Tailscale-authenticated browser connection and protected
agents.listagain. |The grant policy and its admin operation are explicitly fixture-backed. They demonstrate enforcement by real Core, not a native grant-management UI or an external grant store's notification delivery. Network ACL withdrawal, device-token deletion and global
allowTailscale=falsewere not substituted for selective person revocation. A disconnected page can retain previously rendered content; that is not evidence of newly authorized protected I/O.Validation and remaining limits
ae660ef0.Readyexpected,Unavailablereturned after the old five-second aggregate deadline). After repair, 156 verifier/upgrade cases passed. The production runner's existing per-command timeout and cleanup remain in force; explicit verifier deadlines and caller cancellation remain supported.Security Impact
Compatibility and Migration
gateway.auth.allowTailscale=trueonly on the supported managed foreground-Serve topology. No automatic credential deletion or record replacement.Review Conversations
The current evidence materially advances the requested migration/retry/selective-denial proof. Current-head Build and Test and CodeQL passed. Maintainer acceptance and full pool/distribution obligations remain open. No upstream merge or review-thread resolution is claimed.
Current rebase proof (6eabf15c)
Rebased onto upstream main
3670fcd6. The updated WinUI launcher compiles and the full repository build passed on Windows x64. The rebase preserves upstream typed request outcomes and the bound on time spent queued for dispatch. The connection and wizard request suites passed 156 and 16 focused tests on parent60e97867. The final commit changes only a WinUI lambda parameter name. It resolves the sole P0–P3 review finding, and the independent review of that fix returned no further findings.The isolated full-app fixture passed the Dashboard hand-off and retry after a simulated browser failure at this head. The Retry dialog was visible in the capture and the test observed a successful retry for the same route. The earlier live upgrade, selective revocation and independent-authentication proofs above belong to their recorded revisions. A live upgrade rehearsal at the new head remains outstanding.
CI cancellation follow-up (f58ffc04)
The first rebased head reproduced
SearchSessions_CallerCancellationWhileQueuedDoesNotWriteAfterUnlockin the hosted Core and soak jobs. Caller cancellation could unwind and dispose the dispatch deadline before its linked cancellation reached the queued send. The follow-up explicitly cancels that deadline before unwinding.The corrected head passed 19 focused search-cancellation and wizard-request cases. The exact previously failing test also passed in 12 independent test processes. The follow-up P0–P3 review returned no actionable findings. Earlier WinUI fixture evidence above remains bound to
6eabf15c.Additional validation at
f58ffc04GitHub Core and CLI, changed-test soak, and the WSL network-recovery E2E jobs passed. The UI shard timed out reopening the Systems Gateway row at 1000 px. The exact test passed locally at both 1000 and 480 px on the same head. The hosted timeout remains visible in the UI job.
The full native Windows build, Tray suite (7,131 tests), and WinNode CLI suite passed locally. The Shared suite hit 12 symlink-privilege failures. The three Connection failures and the three SetupEngine gateway-timeout formatting failures were reproduced in targeted tests on the pinned upstream baseline.
The full mounted SystemsPageProofTests class also produced the same eight failed cases on this PR and on upstream main at 3670fcd6. The specific 1000 px Gateway row case that timed out on the hosted runner passed locally on both revisions.
Current-head Windows Companion fixture
On
f58ffc04599497cb5ff6c3092825f1f6f1138384, four native app cases passed with a synthetic Gateway. The saved Channels receipt opened the Dashboard, rejected a revoked identity before launch, and remained available for successful retry after a browser failure. The separate Channels navigation case also exercised browser failure and retry. The full-app fixture used isolated Windows state.The latest-stable installed-state upgrade still needs a restorable Windows host and a real existing WSL Gateway. Check that the existing Gateway record, stored credentials and device pairing survive the upgrade, then run the agreed adoption, interruption/retry and denial cases. The hosted Systems-row timeout remains open.