Skip to content

feat: upgrade legacy managed Gateways to Tailscale auth - #1128

Open
TheAngryPit wants to merge 60 commits into
openclaw:mainfrom
TheAngryPit:codex/tailscale-legacy-upgrade-20260807
Open

TheAngryPit wants to merge 60 commits into
openclaw:mainfrom
TheAngryPit:codex/tailscale-legacy-upgrade-20260807

Conversation

@TheAngryPit

@TheAngryPit TheAngryPit commented Aug 8, 2026 •

Copy link
Copy Markdown
Contributor

Related: #1117. Separate from #1989. Maintainer proof requirements.

What Problem This Solves

Existing Companion-managed WSL Gateways lack a supported in-place action to adopt Tailscale Dashboard authentication while preserving existing shared access.

User Impact

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

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

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 main 34e8b609. 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

  • Bug fix
  • Feature
  • Refactor
  • Docs or instructions
  • Tests or validation
  • Security hardening
  • Chore or infrastructure

Scope

  • Tray or WinUI UX
  • Windows node capability
  • Local MCP or winnode
  • Gateway, connection, or pairing
  • Setup or onboarding
  • Permissions, privacy, or security
  • Tests, CI, or docs

Required proof pools

  • 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

  • ./build.ps1 -Project All -Configuration Debug -NoTrustRepository: all five targets passed on native Windows x64, source ae660ef0.
  • 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.
  • Both increments received normal Codex Autoreview (scoped-clean P0–P3), TestAudit and named NoComments. Independent Astra reviewed the native timeout repair and fixture proof plan. The retained comment is machine-consumed timing metadata.
  • On current integration 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.
  • Current-head hosted Build and Test and CodeQL completed successfully. Earlier all-green runs remain historical.

Real Behavior Proof

Published and freshly built source: ae660ef0e692d5dacb7a642cc026bd534560d8df, integrating pinned main 34e8b6099f4cbf225c4247fa814e4823dd75c9d2. 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 for 7676549c/2eb34396 remain historical records.

Environment: Windows x64 Companion, a separate task-owned Ubuntu WSL Gateway running official OpenClaw 2026.11.3 (847611d), Tailscale 1.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=tailscale and successfully requested agents.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 requested agents.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 at auth_validated with cause operator-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.read received FORBIDDEN: missing scope: operator.admin when 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.list again.

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=false were 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

  • Native full five-target build passed on ae660ef0.
  • The deliberate slow-probe regression failed before the fix (Ready expected, Unavailable returned 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.
  • Timing-pattern validation and all 38 determinism-guard tests passed after the required timing directive. No ratchet baseline was raised. Autoreview and named NoComments completed for both increments; NoComments retained the machine-consumed directive.
  • On the frozen integration, 235 focused Connection cases, all 6,712 Tray cases, and 557 focused approval/client integration cases passed. The manual test conflict resolution received scoped Autoreview, NoComments and independent Astra compatibility review.
  • Current-head Build and Test and CodeQL completed successfully. Previous-head green runs remain historical.
  • Local full Shared qualification had 5,871 passes, 30 skips and 12 failures caused by absent Windows symbolic-link privilege. Those failures were not hidden or relabelled green. Current hosted Shared/Core results must be read separately.
  • A previous-version installed-app upgrade, signing/distribution qualification and complete UI proof-pool coverage are not claimed. The local native viewport fixture was blocked at the required 1,000-DIP layout on this display; assertions and display settings were preserved.
  • Local private receipts contain endpoint/profile/device details and are not public artifact links. This summary intentionally omits those details. Maintainer acceptance and merge remain separate.

Security Impact

  • New permissions or capabilities? No new Core provider or operator grant; adds an explicit admin-gated configuration action.
  • Secrets or tokens handling changed? Yes: credential-free links require verified Tailscale readiness; independent browser credentials retain their export authorization.
  • New or changed network calls? Yes: config read/patch and existing managed Serve readiness checks.
  • Command or tool execution surface changed? Existing managed WSL/Serve diagnostics are used; no new end-user permission is granted.
  • Data access scope changed? No broader grant is intended; Core remains the authority.
  • If any answer is Yes, explain the risk and mitigation: captured connection epoch/base hash, explicit admin requirement, leaf-only patch, revalidation before identity readiness, retained credentials and final setup dispatch authority. Real lab denial and migration evidence is recorded above; full qualification and maintainer acceptance remain mandatory before merge.

Compatibility and Migration

  • Backward compatible? The real lab kept the original saved record, device identity and independent credential through opt-in and retry. Its legacy record was seeded through the production registry API; a previous-version installer/data upgrade is not claimed.
  • Config or environment changes? Explicit operator opt-in sets gateway.auth.allowTailscale=true only on the supported managed foreground-Serve topology. No automatic credential deletion or record replacement.
  • Migration needed? Operator-initiated adoption. Core acceptance and local persistence are separate; link creation still verifies applied config and current ingress before omitting a token.
  • Upgrade steps and residual limits: use the Connection menu's opt-in, retain independent access, and use its normal retry after correcting a local persistence failure. The demonstrated interruption was an accepted patch followed by failed local persistence, not an arbitrary power-loss proof. Full pool/distribution acceptance remains open.

Review Conversations

  • I replied to or resolved every bot review conversation addressed by this PR.
  • I left unresolved only conversations that still need maintainer judgment.

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.

@clawsweeper clawsweeper Bot added rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. P2 Normal priority bug or improvement with limited blast radius. merge-risk: 🚨 compatibility 🚨 Merging this PR could break existing users, config, migrations, defaults, or upgrades. merge-risk: 🚨 auth-provider 🚨 Merging this PR could break OAuth, tokens, provider routing, model choice, or credentials. merge-risk: 🚨 security-boundary 🚨 Merging this PR could weaken sandboxing, authorization, credentials, or sensitive data. labels Aug 8, 2026
@clawsweeper

clawsweeper Bot commented Aug 8, 2026 •

Copy link
Copy Markdown

Codex review: needs real behavior proof before merge.

What this changes

Adds an explicit action to enable Tailscale Dashboard authentication on eligible existing managed WSL Gateways while retaining their credentials.

Example: A managed Gateway at wss://openclaw-host.tail1234.ts.net uses verified Gateway-owned foreground Serve.

  • Before: Core allowTailscale and the saved trust preference are false, so Dashboard access requires independent authentication.
  • After: The confirmed action patches allowTailscale, saves trust after acceptance, and permits token-free Dashboard links after applied-state and ingress verification.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) Useful implementation with substantial current-head behavior evidence and green hosted checks, but existing-state compatibility and required Windows qualification remain incomplete.
Proof confidence 🦐 gold shrimp (3/6) Real behavior proof is necessary before merge. See Before merge.
Patch quality 🦐 gold shrimp (3/6) No actionable review findings were identified.

Product

Kind: Feature · Worth it: Yes · Fix scope: Complete
User problem: Existing managed WSL Gateway users lack a supported in-place Dashboard identity opt-in that preserves working credentials and pairing.
Reason: The bounded workflow has clear user value and recorded maintainer implementation and direction; background-Serve conversion and personal identity selection remain explicitly separate.

Merge readiness

⛔ Blocked before merge - 3 items remain

Keep open: this PR provides a distinct, maintainer-engaged legacy Gateway upgrade absent from current main, and no blocking source defect was established.

Priority: P2
Reviewed head: ae660ef0e692d5dacb7a642cc026bd534560d8df

Before merge

  • Add real behavior proof - The full current-head body reports native false-to-true adoption, real Tailscale-authenticated browser requests, accepted-patch/local-save failure and retry, and selective revocation through a fixture policy enforced by real Core on Windows x64/WSL with Core 2026.11.3. These observations address the bounded maintainer scenarios, but gateways.json.TrustTailscaleAuth was exercised using seeded records: latest-stable installed-state upgrade preservation and complete applicable Windows proof-pool qualification remain explicitly unverified. The proof owner should supply redacted upgrade and qualification results, excluding IPs, keys and non-public endpoints. After adding proof, update the PR body, then request a new review with @clawsweeper re-review. The PR author or someone with repository write access can request it.
  • Await maintainer action - Authorize and schedule the remaining applicable Windows proof-pool runs under docs/PROOF_POOLS.md.
  • Add data-model compatibility proof - The review found that existing stored data may not work after upgrade. Show that existing data still loads and works with this change.

Findings

None.

Tests

  • Low-value test tests/OpenClaw.Connection.Tests/GatewayTailscaleAuthLiveVerifierTests.cs: Remove or consolidate the background-only endpoint/proxy rejection cases, including VerifyAsync_RejectsProxyUserInfo and VerifyAsync_RejectsNonCanonicalServeEndpoint: their fixtures lack foreground ingress, so they remain NotReady even if the specific parser rejection regresses; retain those inputs in foreground-route coverage.
  • Missing end-to-end proof: Provide latest-stable v2026.11.1 upgrade evidence preserving saved records, credentials and device identities, and complete the applicable current-head Windows qualification.
Agent review details

How this fits together

Connection settings invoke GatewayConnectionManager, which coordinates Core configuration and the saved Gateway registry; Dashboard entry points consume the shared link service before browser dispatch.

flowchart TD
  A[Connection settings] --> B[Gateway connection manager]
  B --> C[Core configuration RPC]
  B --> D[Managed Serve verification]
  C --> E[Gateway registry]
  E --> F[Dashboard link service]
  D --> F
  F --> G[Browser Dashboard]
Loading

Technical review

Best possible solution:

Retain the explicit, credential-preserving adoption path through the existing connection manager and shared Dashboard link owner.

Do we have a high-confidence way to reproduce the issue?

Current-main source confirms the missing in-place action and trust field, while the original merged Tailscale setup scope explicitly excluded existing-Gateway upgrades; no target code was executed during this review.

Is this the best way to solve the issue?

The supported-topology restriction, leaf-only hash-conditional patch, accept-then-persist ordering and separate readiness checks fit the existing owners and preserve the reviewed authentication boundary.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 0467121e68d2.

Provenance checked

  • Existing-Gateway Tailscale adoption changes intended behavior with a stated reason (8e79ace: The merged setup feature deliberately supported new or replacement Gateways without in-place upgrades.)
  • Dashboard credential handling keeps the original intent (edfdeca: Dashboard routes and credentials must occupy the correct URL components without exposing device/bootstrap credentials.)
  • Dashboard launch ownership and setup authority keeps the original intent (3eed1f1: Onboarding uses a coherent Dashboard handoff with final setup-ownership checks before dispatch.)
  • Managed Gateway metadata preservation keeps the original intent (bc210e0: Equivalent managed endpoints must retain ownership metadata and credential recovery behavior.)

Testing

Proof path: shipped entry point.

Security

None.

Evidence

What I checked:

  • Current main lacks the legacy adoption action: Current main's GatewayRecord has no TrustTailscaleAuth field, and its saved-row menu has no adoption action; the merged setup implementation explicitly excluded in-place upgrades. (src/OpenClaw.Connection/GatewayRecord.cs:33, 0467121e68d2)
  • Narrow adoption and separate readiness checks: The introduced service requires eligibility, an active authenticated connection, admin scope and managed ingress, submits only the allowTailscale leaf, and persists trust after acceptance; subsequent links separately require matching applied hashes and live ingress. (src/OpenClaw.Connection/GatewayTailscaleAuthUpgrade.cs:398, ae660ef0e692)
  • Maintainer direction and bounded acceptance request: bkudiess implemented accept-then-persist semantics and subsequently stated that the fixes looked good, requesting happy-path, recovery and authorization checks: feat: upgrade legacy managed Gateways to Tailscale auth #1128 (comment).
  • Current-head runtime evidence and explicit limits: The complete PR body reports Windows x64, real WSL/Core and browser observations for false-to-true adoption, token-free agents.list, persistence failure/retry, and fixture-backed selective revocation enforced by real Core; it expressly excludes previous-version upgrade and complete proof-pool qualification. The supplied body identity is SHA-256 c4c83df33dc99821e5e08fc42a1b73cadb7b4201af37eca7fe40835805c55b40. (ae660ef0e692)
  • Persisted-state compatibility gate: The PR adds gateways.json.TrustTailscaleAuth; seeded-record persistence and retry observations do not establish preservation through an upgrade from latest stable v2026.11.1. (src/OpenClaw.Connection/GatewayRecord.cs:40, ae660ef0e692)
  • Windows qualification requires maintainer scheduling: The proof-pool contract requires approval and maintainer scheduling, and distinguishes selected-test evidence from complete qualification. (docs/PROOF_POOLS.md:34, ae660ef0e692)

Likely related people:

  • Barbara Kudiess: Raw commit bc210e0 adds src/OpenClaw.Connection/GatewayRecord.cs:96 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: bc210e048aa9; files: src/OpenClaw.Connection/GatewayRecord.cs)
  • Andy Eskridge: Raw commit 8e79ace adds src/OpenClaw.SetupEngine/TailscaleSetupSteps.cs:16 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 8e79aceb5571; files: src/OpenClaw.SetupEngine/TailscaleSetupSteps.cs)

Preflight source

Source unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified.

Review metrics

Metric Value Why it matters
Introduced production and test delta Production +2115/-128; tests +3817/-123 The change crosses configuration, persisted trust, ingress verification and browser dispatch; distinct transport, persistence and authorization coverage accounts for much of the test growth.

Labels

Label changes:

No label changes.

Label justifications:

  • P2: This is an opt-in improvement for a bounded existing-Gateway workflow, with no demonstrated current outage.
  • merge-risk: 🚨 compatibility: The PR adds persisted Gateway trust and changes Dashboard credential selection; released-state upgrade compatibility remains unverified.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🦐 gold shrimp.
  • status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask.

Rating scale

6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only. Repair and merge execution lanes are retired.

History

Review history (35 earlier review cycles; latest 8 shown)
  • reviewed 2026-10-11T20:04:11.081Z sha 6484664 :: needs real behavior proof before merge. :: none
  • reviewed 2026-10-12T20:41:05.376Z sha 7dc1564 :: needs real behavior proof before merge. :: none
  • reviewed 2026-10-12T23:19:10.055Z sha 7dc1564 :: needs real behavior proof before merge. :: none
  • reviewed 2026-10-13T01:22:44.866Z sha d98a0e1 :: needs real behavior proof before merge. :: [P2] Inspect privileged Serve processes with sufficient read authority
  • reviewed 2026-10-13T03:16:56.573Z sha d98a0e1 :: needs real behavior proof before merge. :: [P2] Inspect privileged Serve processes with sufficient read authority
  • reviewed 2026-10-13T04:56:08.896Z sha d98a0e1 :: needs real behavior proof before merge. :: [P2] Inspect privileged Serve processes with sufficient read authority | [P2] Display Dashboard preparation failures with a recovery action
  • reviewed 2026-10-13T05:15:22.133Z sha 82258a4 :: needs real behavior proof before merge. :: [P2] Display Dashboard preparation failures with a recovery action
  • reviewed 2026-11-14T09:48:04.567Z sha ae660ef :: needs real behavior proof before merge. :: none

Reviewed November 14, 2026, 4:54 AM ET / 09:54 UTC (Revision 36).

@TheAngryPit

Copy link
Copy Markdown
Contributor Author

Thanks for flagging the config.patch boundary. I checked it against both the pinned Core used by the runtime and current main:

Both pass the submitted object to applyMergePatch(snapshot.config, normalizedPatch, ...). The partial leaf patch in this PR is therefore intentional. Sending the full config.get snapshot would be unsafe because unrelated null values would become JSON Merge Patch deletion markers.

The regression test deliberately verifies that an unrelated top-level field is absent from the submitted patch. I added a source comment documenting this invariant; no behavior changed in that follow-up commit.

The draft remains blocked on the product/security decision in #1117 and does not claim exact-head runtime proof for the new failure branches.

@clawsweeper please re-review the updated head.

@clawsweeper clawsweeper Bot added rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. and removed rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. labels Aug 8, 2026
@TheAngryPit

Copy link
Copy Markdown
Contributor Author

CI follow-up on exact head 00bfdd70:

The setup-connect E2E exposed a real regression in ExternalLike_QrOnlyFreshTray_RequiresExplicitDeviceApproval: the new early guard rejected the existing bootstrap credential path before the Dashboard URL could be returned.

The fix removes only that guard. Existing behavior remains:

  • QR/bootstrap onboarding may return its Dashboard URL without appending the bootstrap token;
  • shared-token URLs still append the token when Tailscale identity is not trusted;
  • shared-token omission still requires the persisted marker plus authoritative Core revalidation.

Fresh proof after the correction:

  • Dashboard URL builder tests: 4/4 passed
  • Tray suite: 2166/2166 passed
  • git diff --check: passed
  • scoped Auto-review: no findings, patch correct, confidence 0.96

The draft remains blocked on #1117's product/security decision and exact-head runtime-proof gate. The new CI run is the supported E2E proof for this head.

@TheAngryPit

Copy link
Copy Markdown
Contributor Author

Exact-head architecture and upstream reconciliation proof for b57cc9c6:

  • Addressed the prior P2 by extracting GatewayDashboardLinkService, shared by the tray launch and local MCP paths. App.xaml.cs now retains composition, logging, UI error display, and launch only.
  • Preserved the existing native contract: authoritative Tailscale revalidation omits the shared credential; failed revalidation falls back only to an already-approved browser credential; otherwise the action fails closed.
  • Merged current upstream main (9f9a8eda). The two conflicts were additive: retained upstream GatewayDirectConnectService/validation tunnel wiring and this PR's dashboard-link service.

Fresh proof after the merge:

  • focused dashboard/service/architecture tests: 10/10
  • full build: Shared, CLI, WinNodeCli, SetupEngine, and WinUI succeeded
  • dependency preflight: passed
  • canonical sequential closeout: Shared 3636/3636 with 32 skipped; Tray 2253/2253
  • git diff --check: passed
  • whole-branch Auto-review against current origin/main: no accepted/actionable findings, patch correct, confidence 0.87

The first closeout run had one unrelated telemetry-listener test failure. The exact test passed on one bounded rerun, and the canonical closeout then passed in full; no telemetry code was changed.

This is test/build/review proof, not current-head runtime or end-to-end proof. The draft remains blocked on the legacy-gateway authorization-policy decision and an inspectable redacted runtime artifact showing Core/local convergence, retained fallback credentials, and token-free Dashboard authentication.

@TheAngryPit
TheAngryPit marked this pull request as ready for review August 8, 2026 14:11
@TheAngryPit
TheAngryPit force-pushed the codex/tailscale-legacy-upgrade-20260807 branch from b57cc9c to afc9111 Compare August 9, 2026 19:20
@TheAngryPit

Copy link
Copy Markdown
Contributor Author

Current-head Windows runtime proof

I tested the published #1128 head as part of a combined Windows Companion candidate at 00a61d3a75a615ff4f2b80b30da4df4eb6df18ee.

The supported build passed all five projects. Focused validation passed 1,073 tests with zero failures, and the canonical Shared/Tray closeout passed 5,896 tests with zero failures (32 existing integration-category skips).

The exact candidate was then installed and exercised through the supported app.dashboard.url entrypoint. The sanitized result was:

{
  "revalidated": true,
  "success": true,
  "trustTailscaleAuth": true,
  "credentialFragmentPresent": false,
  "errorCode": null
}

This provides runtime proof that the installed Companion revalidated the authoritative Core setting and produced a successful trusted-auth dashboard result without including the retained fallback credential. No browser or Launcher was invoked, and no URL, token, endpoint, gateway identifier, or raw Core response was persisted.

The temporary Local MCP proof surface was returned to Off immediately afterwards. The original settings hash, process identity, binary identity, and zero-listener state were confirmed. The generated MCP credential file remains stored by the product's normal design; its value was never read or emitted.

Scope note: this Gateway had already adopted trusted auth, so the proof exercises current-head revalidation and token-free result construction rather than replaying the initial false -> true adoption transition. An independent test on a Gateway that has not adopted the setting yet would usefully cover that remaining transition.

Sanitized agent transcript
[assistant]
I will work only in the #1128 staging worktree and the allowed surfaces. I am checking the saved-row path, focused service entrypoint, and contract tests before changing production code.

[assistant]
Failed-first was captured: the saved-row method did not delegate to the focused service. The minimal change retains the credential-provenance gate and routes policy through the authoritative service.

[assistant]
The supported build passed all five projects. Focused Connection, Setup, Shared, and Tray validation passed 1,073 tests with zero failures; canonical Shared/Tray closeout passed 5,896 tests with zero failures.

[assistant]
The exact combined candidate was installed. Read-only inspection confirmed the running executable and assemblies identify the expected SHA, with trusted auth active and the approved shared fallback retained.

[assistant]
After explicit operator authorization, the supported `app.dashboard.url` capability returned `revalidated=true`, `success=true`, `trustTailscaleAuth=true`, and `credentialFragmentPresent=false`. Browser and Launcher were not invoked, and no URL or credential value was persisted.

[assistant]
Local MCP was restored to Off. The settings hash, process, binary identity, and zero-listener state matched the pre-probe state. The product retained its generated bearer-token file by design; its value was never read or emitted.

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Aug 10, 2026 •

Copy link
Copy Markdown

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

@clawsweeper clawsweeper Bot added rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. and removed rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. labels Aug 10, 2026
@TheAngryPit

TheAngryPit commented Aug 10, 2026 •

Copy link
Copy Markdown
Contributor Author

Addressed the remaining contributor-owned localization finding on exact head 653135c.

  • Replaced the six new hard-coded Tailscale dashboard-authentication strings with resource lookups.
  • Added localized resources for all five supported locales: en-US, fr-FR, nl-NL, zh-CN, and zh-TW.
  • Added a focused source-contract regression covering every lookup.

Validation:

  • Failed first: the new focused regression failed 0/1 because the resource lookups were absent.
  • LocalizationValidationTests: 16/16 passed.
  • Supported build: 5/5 projects passed.
  • Shared: 3,636 passed, 32 skipped, 0 failed.
  • Tray: 2,257 passed, 0 failed.
  • git diff --check: passed.

The maintainer policy decision for the legacy identity authorization boundary and current-head proof of the initial untrusted-to-trusted transition remain open gates; this commit does not claim to resolve either.

@TheAngryPit

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Aug 10, 2026 •

Copy link
Copy Markdown

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

TheAngryPit commented Aug 12, 2026 •

Copy link
Copy Markdown
Contributor Author

Initial-adoption proof — provenance correction

Correction: the installed combined Windows build 00a61d3a75a615ff4f2b80b30da4df4eb6df18ee contained PR #1128 commit afc91117402e0ca46834faee791150ded570a90a, not the later localization-only head 653135ce02ad3814604879b516b8e18e7f1b4593. The previous wording incorrectly described the installed candidate as containing the exact current head.

The operator and Codex ran one bounded, explicitly authorized, reversible transition through the installed Companion's supported Connection UI. The transition observations and receipt below are runtime evidence for the authentication implementation at afc91117402e0ca46834faee791150ded570a90a.

The current PR head is one descendant commit ahead. Its complete afc911...653135 delta only replaces six UI strings with resource lookups, adds the corresponding values to the five existing locale files, and adds a localization source-contract test. It does not change the upgrade transaction, persisted trust marker, Core patch/revalidation, credential fallback, dashboard-link policy, or rollback behavior. Exact-head CI is green, including both Windows builds, the full test job, setup/connect, network-recovery and revocation-recovery E2E lanes, repository hygiene, and the advanced setup gate.

Accordingly, the strongest accurate proof is: runtime_proven for the unchanged authentication path at afc911, plus code_proven source equivalence and test_proven exact-head validation at 653135. This does not claim that a binary built from 653135 itself was installed or exercised.

Sanitized result:

{
  "status": "pass",
  "proofLevel": "runtime_proven_plus_exact_head_equivalence",
  "runtimeProvenPrCommit": "afc91117402e0ca46834faee791150ded570a90a",
  "currentHead": "653135ce02ad3814604879b516b8e18e7f1b4593",
  "currentHeadDelta": "localization_only",
  "initial": {
    "coreAllowTailscale": true,
    "localTrustMarker": true,
    "sharedFallbackPresent": true
  },
  "controlledReset": {
    "coreAllowTailscale": false,
    "localTrustMarker": false,
    "sharedFallbackRetained": true
  },
  "adoption": {
    "entrypoint": "supported_companion_connection_ui",
    "fallbackReconnectSucceeded": true,
    "coreAllowTailscale": true,
    "localTrustMarker": true,
    "sharedFallbackRetained": true
  },
  "rollback": {
    "originalBooleanStateRestored": true,
    "companionRunning": true
  }
}

What this proves:

  • both authoritative Core state and the local trust marker were placed in the initial untrusted state;
  • the approved shared fallback credential remained retained;
  • the supported UI action reconnected through that fallback;
  • Core accepted gateway.auth.allowTailscale=true;
  • the local marker converged to true;
  • fallback material remained present after adoption;
  • rollback restored the original boolean state and the Companion remained running;
  • a separate visual readback showed the Companion Connected, with no update modal or visible error.

The receipt SHA-256 is 77FAE217592B1BDE1B88778370C11217DFF874BF7611E1AC32C255BCAC2D169D.

Receipt provenance note: the hashed receipt's prHead metadata repeats the same mistaken 653135 label; treat that field as superseded by this correction. The observed runtime values are unchanged, and the installed candidate provenance is afc911 within combined build 00a61d3.

Redaction: no URL, token, Gateway identifier, raw response, or secret value was persisted or included here. No update was installed. The two disposable identity runtimes used during diagnosis were removed after verification.

This closes the behavioral initial-adoption proof gap through runtime evidence for afc911 and exact, reviewable source/test equivalence for the localization-only current head. The maintainer decision about the legacy tailnet authorization boundary remains intentionally open.

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper clawsweeper Bot added proof: sufficient Contributor real behavior proof is sufficient. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. labels Aug 12, 2026
@TheAngryPit

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@TheAngryPit
TheAngryPit force-pushed the codex/tailscale-legacy-upgrade-20260807 branch from 653135c to b51aa91 Compare August 17, 2026 18:31
Integrate 8dfedf9 without
rewriting contributor or maintainer commits. Preserve Workspace-only
window ownership and the main closure rows.

Clarify the two retained Dashboard rows: the link service owns Tailscale
revalidation and fallback, while the URL builder owns scheme and token
fragment construction. Independent incremental P0-P3 review passed.

No auth implementation or runtime proof is claimed by this docs resolution.
The four maintainer-required human proof pools remain open.
Integrate maintainer commit 067c58f.
Assert GatewayRequestRejectedException with exact codes and messages for
session creation and chat abort fixture rejections. Keep request inputs,
negative cases, cancellation limits and production authority behavior intact.

Validation: narrow Shared.Tests build passed; five focused cases passed.
The earlier hosted cancellation timeout did not reproduce; its cause remains
unexplained. Independent incremental P0-P3 review found no actionable issues.
@bkudiess

Copy link
Copy Markdown
Collaborator

The maintainer repair was pushed in 54b73293 and is preserved in eb6b6e4a55387581d087dca951f956f8d525945b. Here is the collected credential-free proof. This is not merge approval.

Repaired behavior

  • The auth-only action checks configured Core-managed Serve and live ingress before mutation. Default setup's background Serve is rejected explicitly; it is not silently migrated.
  • New trust is saved only after confirmed Core acceptance, leaving a failed or unknown new opt-in retryable. Accepted configuration is not presented as completed asynchronous readiness.
  • app.dashboard.url reports actual browser-token inclusion, separately from selected-credential provenance. Bootstrap provenance coverage is restored.

These accept-then-persist semantics supersede the historical pre-dispatch persistence/rollback description and its old durable-intent question. Earlier f9b58bf evidence does not describe the repaired implementation.

Validation at eb6b6e4

The default full .\build.ps1 -NoTrustRepository and fixture-host build passed. Earlier invalid generated reference assemblies were repaired by ordinary project rebuilds; no source or correctness checks were changed for that recovery.

Local test scope Passed Failed Skipped
Full Shared 4641 0 25
Full Tray 4486 0 0
Focused Connection/Tailscale 164 0 0
Focused SetupEngine/Tailscale 3 0 0
Full WinNode CLI 129 0 0

Canonical run 39507834238 remains failed. Core/CLI and Tray/setup passed. The remaining reported failure is LocalAiHardwareProfileTests.LocalAiPage_RendersHardwareFallbackOrUnavailable(vramGiB: 6, theme: Light), with cancellation during label capture in OnboardingNativeProof.AssertLabelsAsync; the dependent CI Gate failed. The cause is not established, and no timeout was relaxed or CI rerun requested.

Hosted setup/connect passed 40 with seven MXC skips; network recovery passed 2/2 and revocation recovery 1/1. Those skips are not MXC proof, and ordinary recovery is not Tailscale application-grant revocation proof.

Recorded real behavior

  • Strict Gateway/MXC at 93719d63: one .\scripts\validate-mxc-e2e.ps1 -NoBuild attempt, exit 0, 18 passed / 0 failed / 0 skipped. Real node execution, protected-data write denial, safe-port recording, and executable/tail allowlist cases passed. Owned distro, profiles, processes, tasks, and listeners were cleaned up. This precedes eb6b6e4a and is not labeled a fresh strict run of the newer head.
  • Real Companion plus synthetic loopback Gateway at eb6b6e4a: winnode --list-tools discovered 33 tools including app.dashboard.url; status was Connected/Ready. Dashboard invocation returned shared-token provenance, actual inclusion true, and hasTokenQuery=false; the generated URL had a token fragment. Token values were excluded from the proof summary.
  • The owned Connection window was inspected and captured. This establishes the connected/MCP-only fixture baseline, not the Tailscale-specific confirmation/status/retry states. Both bounded UI labs were cleaned up; real-tray metadata was unchanged.

Strict-run isolation caveat: an unowned E2E distro disappeared while another worktree's testhost was active. No observed owned command or our uninstall log named it. Causality remains unproven, so blanket shared-host invariance is not claimed.

Still not verified

  • Real Tailscale identities, application-grant denial/revocation/restoration, independently approved live shared fallback, and their corresponding UI states were intentionally deferred from this credential-free pass.
  • Signed previous-release upgrade/rollback was not run.
  • The strict MXC receipt is for 93719d63; a newer-head refresh would be a separate approved attempt.
  • Current-head CI must be green before treating the PR as ready.

Full local logs, TRX, immutable review records, ownership/cleanup manifests, and hashes are retained. Strict TRX SHA256: 5015672F57AC6413A34B2AC5DA2A4E99B69293FBAADF465177A9EA041A7F956D. Redacted live MCP receipt SHA256: 1F1A5B45C13A9B543805BDE3D68D32620DE46BBBC08298009D9417BC19E17084.

Record credential-free failure phase, timing and runtime metadata without changing OCR deadlines, label checks or fallback behavior. Preserve the original exception if diagnostics fail.

The independent P0-P3 review and UI-test project build passed. Full product build and all 4486 Tray tests passed. Shared retained one symlink-privilege setup failure before assertions and 26 explicit skips. The historical OCR cancellation cause and native authorization and upgrade proof remain open.
Integrate 2b7cfce without rewriting contributor or maintainer history. The sole conflict keeps the reviewed OCR diagnostics and adopts main's two current onboarding fallback labels.

The one-line resolution passed an independent P0-P3 review and the current UITest project build. Existing Shared symlink-privilege and native authorization, UI and upgrade proof gaps remain open. No OCR timeout or assertion was weakened.
@bkudiess

Copy link
Copy Markdown
Collaborator

Thanks for sticking with this. CI is green and the fixes look good. Before merging, I’d just like a small real-world check of the upgrade and its failure path:

  • Happy path: On a supported existing Gateway, enable Tailscale identity and confirm the Dashboard opens without a token, while existing credentials and connections still work.
  • Recovery: Confirm a failed or interrupted upgrade leaves existing access working and lets the user retry.
  • Authorization: Confirm a denied or revoked Tailscale identity cannot access the Dashboard without separate, valid authentication.

A short recording or redacted output is fine. Please include the tested commit, Core version, and Serve configuration so we know which setup was exercised.

Also, please update the opening description to say trust is saved after Core acceptance, and note that background-Serve setups are not migrated by this action.

@TheAngryPit

Copy link
Copy Markdown
Contributor Author

The opening now states that trust is saved after Core acceptance and that this action does not migrate background-Serve setups.

For the authorization check on b0cabd5f, I plan to use a disposable Gateway: keep Serve reachable, disable Tailscale identity authentication with the documented gateway.auth.allowTailscale=false, verify a new identity-only connection is denied, then verify separately approved token/password authentication still works. Finally, restore Tailscale authentication and reconnect.

This would be labelled global Tailscale authentication disable; it would not demonstrate selective per-user revocation. The case has not been run yet.

Does that meet your current denial check, or do you also require selective per-profile revocation?

@roboclaw-bot

Copy link
Copy Markdown
Contributor

PR cleanup review

Reviewed head: b5d6954e6ca98e75e0514915645de7e3bbc496b1. Main comparison: e59374c064f43d68f5c72d070d4c89ef2d20ec3b.

This is not superseded by main's new-setup Serve support or by #1989 (feat(auth): use personal Tailscale identity in Companion), which explicitly handles a different personal-Companion-auth scope. Please integrate the current ConfigPatchResult owner without restoring ChannelsSnapshot, and preserve GatewayDashboardLauncher's final dispatch authorization. For proof, the latest maintainer request remains the bounded one: existing-Gateway enable/token-free access with independent credentials preserved; failed/interrupted upgrade with usable access and retry; and denied/revoked Tailscale access without independent valid auth. The historical second-identity capture withdrew a network ACL, not the application grant. Please clarify whether the proposed global allowTailscale=false case satisfies the requested denial scenario, then record the accepted cases on the final head. Green hosted CI and historical MXC results are useful but do not substitute for that changed-path evidence.

Action in this cleanup pass: leaving this PR open. No branch changes or runtime-proof waiver. The findings above come from source, discussion and recorded-CI review; Windows validation was not rerun in this pass.

@TheAngryPit

Copy link
Copy Markdown
Contributor Author

Updated the branch onto main bf61595e and retained the reviewed root-URL equivalence repair. Reapplying an official setup code now reuses the original managed record for equivalent root URLs, preserving its identity and metadata. The integration also updates the Dashboard test caller and adopts main's existing configurable test hang guards without changing product deadlines, negative-observation intervals, assertions or ratchet baselines.

Tested Companion commit: 19f586b9cf91f2cc23926bdcbebe70caf96d79dd (Debug, Windows x64).

Validation:

  • Official build.ps1 -Project All -Configuration Debug -NoTrustRepository: passed.
  • Focused Connection/registry/setup/upgrade tests: 154 passed, 0 failed/skipped.
  • Full Tray suite: 6,540 passed, 0 failed/skipped.
  • Full Shared suite: 5,859 passed, 12 failed, 30 skipped. All 12 failures report missing Windows symbolic-link privilege; no tests were disabled or permissions changed to hide them.
  • Normal Codex source/increment reviews: scoped-clean P0-P3. Test audit and independent no-comments review completed. These reviews do not establish live behavior.

Fresh bounded native behavior on that exact build, using an isolated task-owned profile against an existing Windows/WSL Gateway (OpenClaw 2026.11.3, revision 0f6610c, Tailscale Serve mode):

  1. Applied a freshly generated official setup code. The existing managed record was selected; the record count did not increase. An existing historical duplicate was preserved, not silently removed.
  2. Observed PairingRequired, approved only the matching task-owned device through the supported CLI, then read back Ready with identity.DeviceToken and node mode disabled.
  3. Invoked the normal Connection menu → Use Tailscale identity for dashboard → Enable. The UI reported Core acceptance and the original record's trust preference persisted from false to true.
  4. app.dashboard.url returned HTTPS, usesSharedGatewayToken=false, hasTokenQuery=false, and no fragment. This checks the link result, not a rendered/authenticated Dashboard.
  5. Switched through the normal saved-Gateway Connect action to the other pre-existing task device. It reached Ready with its independent identity.DeviceToken after opt-in. This demonstrates preserved device-token access, not the separate shared-token scenario.

Independent rubber-duck review found no new actionable defect in its bounded implementation/proof review and agreed that normal publication is reasonable with these gaps explicitly retained.

The Gateway already had allowTailscale=true before this run. This demonstrates the actual client opt-in and accepted idempotent Core patch, not a server false-to-true migration.

Still not verified / blocked: browser rendering is unavailable because browser launch was refused by host policy; no alternative route was used to bypass that refusal. Interrupted-upgrade recovery/retry, independently preserved shared-credential access, application-level denied/revoked identity, and signed installer upgrade still need their own evidence. This update does not claim complete migration qualification or merge readiness.

@TheAngryPit

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Nov 14, 2026 •

Copy link
Copy Markdown

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot removed proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. merge-risk: 🚨 security-boundary 🚨 Merging this PR could weaken sandboxing, authorization, credentials, or sensitive data. labels Nov 14, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merge-risk: 🚨 compatibility 🚨 Merging this PR could break existing users, config, migrations, defaults, or upgrades. P2 Normal priority bug or improvement with limited blast radius. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants