Skip to content

fix(setup): drop leftover gateway tokens during uninstall - #1481

Merged
bkudiess merged 15 commits into
openclaw:mainfrom
SebTardif:fix/f015-drop-leftover-gateway-tokens
Oct 20, 2026
Merged

bkudiess merged 15 commits into
openclaw:mainfrom
SebTardif:fix/f015-drop-leftover-gateway-tokens

Conversation

@SebTardif

@SebTardif SebTardif commented Sep 23, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Uninstall deleted GatewayUrl but left legacy Token and BootstrapToken. The next launch fell back to ws://127.0.0.1:18789 and could import those secrets into a new record.

Why

A token without a persisted gateway URL is uninstall residue, not a safely attributable credential. Binding it to the default local URL could expose it to the next listener on that port.

User Impact

Uninstall removes Token and BootstrapToken with GatewayUrl. URL-less legacy credentials and root identity are not bound to the default URL. The user reconnects explicitly with a fresh setup code or supplied URL and token. An explicitly saved URL and active registry credentials retain their compatibility paths.

Evidence

The original contributor commits remain intact. Current main was merged normally, then the bounded maintainer repair closed two lifecycle bypasses found by rubber-duck review: settings save no longer repersists the in-memory default URL, and operator/node startup backfill no longer binds root identity without an explicitly persisted target. No force push was used.

origin/main at 94006b3672a034983e80a78dafe311e24ba80cce conflicted in ChatPage.xaml.cs. The merge keeps main's credential parameter flow and still passes GetLegacyCredentialGatewayUrlOrNull() into chat resolution, so a URL-less legacy token is not attached to the default gateway URL. No force push was used.

Merge head: 3286b88b66ecc770aed57bdfd8fb35f6da721955. Test-wait head: 285346ac3fece4a95547f7fc8d284506c021a7d4. Rollback head: 999a05c9048dabe670e958e05c803c23a13e8c2a. Final head: 632aae785f9cedfd659be2453693192073388083. The test-wait commit only widens one connection test wait.

Main moved again and GitHub reported the pull dirty. Merge head 46ad84f8b735409a676beabbe7fd74756d18ce72 brings origin/main 817b0b58 in. The only content conflict was the using list in SettingsManagerIsolationTests. This branch's socket usings stay, and main's MXC, test-support, and tray usings stay. ./build.ps1 exited 0. Shared tests: 4280 passed, 34 skipped. Tray tests: 4025 passed. A signed installer of 46ad84f8 is still not a release asset. 999a05c9 keeps an unsaved gateway target unsaved when a settings save or a direct connect rolls back. 632aae78 records the socket check for that behavior. The earlier installer and app proof below was captured on 29c83ff9ca877b39bb7507dea1a0e7b105f6a5c5, except for the rollback checks, the socket check, and the signed alpha matrix recorded later.

ConnectNodeOnlyAsync_StalledRetirementDoesNotBlockManagerDisconnect timed out once on 3286b88b because the test waited 3 seconds while the coordinator allows the previous node disconnect 2 seconds. The test now waits 10 seconds. It passed locally in 3 seconds.

Required proof pools

  • windows-clean-installer-upgrade: Partially verified, signed-current-artifact blocked. The exact head built a 146.36 MB x64 Inno candidate on a clean Azure Windows host, installed over the previous release, and installed the current uninstall helper plus migration checker. The current candidate is locally built and unsigned, so it cannot satisfy the exact signed-current-artifact requirement. Published OpenClawCompanion-Setup-x64.exe from v2026.9.5-alpha.61 and v2026.9.5-alpha.97 are Authenticode Valid and signed by CN=OpenClaw Foundation. They are not a signed build of this head. The Server 2022 host also cannot complete the destructive cleanup path: AppX registration discovery returns unknown and its wsl.exe is a non-functional stub. Both conditions correctly activate existing fail-closed state preservation. No product guard was weakened to make the proof pass.
  • node-mcp-live: isolated current-head app/MCP proof passed locally for the credential boundary.

Validation

Native Windows validation at head 632aae785f9cedfd659be2453693192073388083:

Command Passed Failed Skipped
.\build.ps1 All five projects 0 0
dotnet test .\tests\OpenClaw.Shared.Tests\OpenClaw.Shared.Tests.csproj --no-restore 4,263 0 33
dotnet test .\tests\OpenClaw.Tray.Tests\OpenClaw.Tray.Tests.csproj --no-restore 4,017 0 0

Native Windows validation after the main merge, head 3286b88b66ecc770aed57bdfd8fb35f6da721955:

Command Passed Failed Skipped
.\build.ps1 All five projects 0 0
dotnet test .\tests\OpenClaw.Shared.Tests\OpenClaw.Shared.Tests.csproj --no-restore 4,263 0 33
dotnet test .\tests\OpenClaw.Tray.Tests\OpenClaw.Tray.Tests.csproj --no-restore 4,013 0 0

Connection and SetupEngine suites were not rerun on this merge head.

Native Windows validation at the previous head 29c83ff9:

Command Passed Failed Skipped
.\build.ps1 All five projects 0 0
dotnet test .\tests\OpenClaw.Shared.Tests\OpenClaw.Shared.Tests.csproj --no-restore 4,115 0 32
dotnet test .\tests\OpenClaw.Tray.Tests\OpenClaw.Tray.Tests.csproj --no-restore 3,171 0 0
dotnet test .\tests\OpenClaw.Connection.Tests\OpenClaw.Connection.Tests.csproj --no-restore 1,121 0 1
dotnet test .\tests\OpenClaw.SetupEngine.Tests\OpenClaw.SetupEngine.Tests.csproj --no-restore 1,201 0 1

Focused uninstall, settings lifecycle, credential resolver, startup/chat contract, and installer assertions also passed. The production PowerShell reset helper ran under Windows PowerShell 5.1 in isolated directories for both PreserveNodeSettings modes, including atomic-write failure handling and repeat-call stability.

Rubber-duck review initially found two blocking lifecycle gaps; both were fixed and re-review found no remaining blockers. Autoreview did not invoke its model because its scanner rejected removed pre-existing synthetic credential literals before review. Canonical dummy fixtures were used for new tests; the scanner limitation is not a code-review finding.

Real behavior proof

Local isolated app and MCP

Current-head isolated runtime proof showed:

  • zero saved gateway records;
  • operator and node remained idle with no gateway target;
  • dashboard credential resolution returned unconfigured;
  • a forced settings save left GatewayUrl, Token, and BootstrapToken absent;
  • retained root identity stayed present but unused;
  • explicit saved-URL and active-registry compatibility paths remained covered by focused tests.

This directly verifies that a URL-less retained identity cannot authorize the default-port listener through the app's final credential-selection boundary.

Crabbox clean Windows proof

  • Provider: azure
  • Target: windows, mode normal
  • Lease: cbx_24ba59036876 (silver-barnacle, Standard_D16ads_v6)
  • Exact source: 29c83ff9ca877b39bb7507dea1a0e7b105f6a5c5
  • Exact-head sync/build run: run_c289cae9bc9e (portal=-, logs=-)
  • Upgrade/uninstall trace run: run_01436fd1a997 (portal=-, logs=-)
  • Migration admission diagnosis: run_89013bd17492 (portal=-, logs=-)
  • Lease cleanup: stopped and deleted successfully.

Observed results:

  1. The exact head built the x64 installer successfully and installed it over the previous release.
  2. Before uninstall, the installed payload contained the exact current Uninstall-LocalGateway.ps1 token-removal logic and Test-InnoMigration.ps1.
  3. Silent uninstall completed, but the existing migration checker returned 2 because Server 2022 could not read Store registration. Inno correctly preserved gateway state rather than performing an unsafe destructive cleanup.
  4. A controlled migration-checker pass then reached the WSL boundary, where the host's stub wsl.exe returned usage text for list, terminate, and unregister. The helper correctly failed closed instead of claiming cleanup.
  5. The local candidate is unsigned. The prior release installer is signed, but a signed build of head 29c83ff9 is not a GitHub release asset.
  6. Published OpenClawCompanion-Setup-x64.exe assets do exist. v2026.9.5-alpha.61 (128,224,112 bytes) and v2026.9.5-alpha.97 (128,706,568 bytes) both returned Authenticode status Valid, subject CN=OpenClaw Foundation, O=OpenClaw Foundation, L=Mill Valley, S=California, C=US. Those files are not a signed build of head 632aae78. Launching the newer exe with /? opened the installer GUI, which was stopped before it installed anything. The upgrade, launch, repair, and uninstall of those two files was run later on this PC. See Signed installer upgrade and uninstall on this PC. That published uninstall left the seeded token keys.

These remote limitations are explicit proof blockers, not successful cleanup claims. The changed token-removal function itself is covered by the passing Windows PowerShell 5.1 production-helper tests and the local isolated runtime proof above. That isolated app/MCP run and the Azure installer trace are from 29c83ff9, not from the final head. Rollback rejection before credential I/O is recorded below. A signed installer built from 632aae78 is still not a release asset.

Signed installer upgrade and uninstall on this PC

Two published x64 installers, both Authenticode Valid, signer CN=OpenClaw Foundation, O=OpenClaw Foundation, L=Mill Valley, S=California, C=US:

Role SHA-256 Product version
Older 4F5FA904B4353948E443D8F7DE67C4BBA52EB988A941BFE0520529E9FDF3EA8F 2026.9.5-alpha.61+24263d3b06c4f2c3af1c7d9c1c834d43323ea9bc
Newer 96F90A2819BA269C6939229079C398AF26EB960404989F0F22D5D78CE17A3554 2026.9.5-alpha.97+7127c16d537cf9d2d92012cc0c16ea6d3c7c73a7

They are not a signed build of head 632aae78. The install used /VERYSILENT /SUPPRESSMSGBOXES /NORESTART /CURRENTUSER into a temporary directory, not the everyday install folder.

  1. Older installer: installation process succeeded. Installed tray product version was alpha.61.
  2. A settings file with no GatewayUrl and with Token and BootstrapToken present was seeded before the upgrade.
  3. Newer installer: exit 0. Installed tray product version became alpha.97. The same three settings keys were still present.
  4. The installed tray started (pid 39388) and was then stopped.
  5. Repair with the newer installer: exit 0.
  6. unins000.exe /VERYSILENT /SUPPRESSMSGBOXES: exit 0. The installed tray exe and uninstaller were removed. Token and BootstrapToken were still present afterward. That is the published alpha uninstall, not the token removal in this pull.

Silent uninstall unregistered OpenClawGateway. That distro was exported before the run and imported again afterward. It is registered and stopped. Ubuntu-24.04 stayed running. Port 18789 stayed in use by wslrelay. The original tray AppData file was restored after the settings check. The bundled Visual C++ redistributable asked for administrator permission and was stopped so the file copy could finish. That skip only suppresses the installer's automatic tray launch.

Rollback does not admit the setup gateway

On head 999a05c9, a URL-less profile still exposes the setup URL from the GatewayUrl getter. That value is not a saved target.

  1. A conflicting UpdateAndSave assigned that getter back through the setter. That was the path that left HasPersistedGatewayUrl true. After the exception, PersistedGatewayUrl and GetLegacyCredentialGatewayUrlOrNull() were null. InteractiveGatewayCredentialResolver.TryResolve returned false for the root device identity and for the leftover token strings. No chat URL was built, and no request was sent to the setup port.
  2. The same failed save against an explicitly saved wss://saved.example.invalid kept that URL as the legacy credential target.
  3. GatewayDirectConnectService.ConnectAsync from a URL-less profile to wss://candidate.example failed and rolled back. The registry was empty, the saved GatewayUrl was blank, and the resolver returned no credential. A previously saved gateway URL still restored.

On head 632aae78 the same production types also opened sockets:

ALLOWED_LISTENER port=62214 tcp_accepts=1 request=GET /chat token_query=present
SETUP_PORT port=18789 own_tcp_before=0 own_tcp_after=0
DIRECT_CONNECT_ROLLBACK setup_port=18789 own_tcp_before=0 own_tcp_after=0

An explicitly saved ws://127.0.0.1:62214 gateway produced one TCP connection to that listener. The request line was GET /chat and the query included a token. The token value is omitted here. After the failed URL-less save, and after the failed URL-less direct connect, this process had zero TCP connections to port 18789.

The direct-connect rollback directory from that test was then loaded by the current-head tray executable, OpenClaw.Tray.WinUI.exe from this worktree's Debug win-x64 build. The directory had an empty gateway registry, no GatewayUrl, and no Token or BootstrapToken. The isolated process opened its setup window, then logged that the profile has no explicitly managed gateway and skipped lifecycle actions. It then logged that the gateway URL was not configured and that client initialization was skipped. That process had zero TCP connections to port 18789. It was stopped after the log line. The saved settings still had no GatewayUrl, Token, or BootstrapToken.

A second launch of that same executable kept the failed save and the network consumer in one process. The profile still had no GatewayUrl. Auto-start was true, so startup reconciliation tried to save. An external writer changed the file first. That process logged, in order:

Auto-start setting corrected from True to False to match Windows.
Failed to reconcile auto-start with Windows: Settings changed in another writer. Reload before saving.
Isolated profile has no explicitly managed gateway; skipping lifecycle actions.

The next line recorded that the gateway URL was not configured and that client initialization was skipped. The failure was 09:23:21.521 and the skip was 09:23:21.525. The process id was 44676. It had zero TCP connections to port 18789. It was stopped after the log was written.

Tray consumer on head 632aae7

The same Debug win-x64 OpenClaw.Tray.WinUI.exe built from 632aae78 was launched twice in isolated data directories. Neither process was the installed tray. Both were stopped after the trace.

Allowed saved target. Settings stored GatewayUrl as ws://127.0.0.1:65180. The active registry record used that same URL and was not marked local, so the managed-local shared-token gate did not apply. The credential was that record's device token. The log said Connecting to credentialed gateway during startup: ws://<host>:65180/ (identity.DeviceToken) and then Connecting to gateway: ws://<host>:65180/. The loopback listener on port 65180 accepted 4 connections. The first request line was GET / HTTP/1.1 and it had no token query. That process had zero TCP connections to port 18789.

GatewayUrl save conflict in the running tray. The profile had no GatewayUrl, AutoStart false, MCP on, and node mode off. Token and BootstrapToken were present, and the root device-key-ed25519.json was present. Startup logged Started MCP-only node service without gateway connection. An external writer then flipped ShowNotifications and left the token fields in place, still with no GatewayUrl. winnode --command app.connection.connectSharedToken targeted ws://127.0.0.1:65171. The tool returned outcome=ConnectionFailed, connected=false, and this error:

Failed to synchronize gateway settings: Settings changed in another writer. Reload before saving. Settings rollback failed: Settings changed in another writer. Reload before saving.

That candidate listener accepted 0 connections. The process had zero TCP connections to port 18789 before the call and zero after it. The settings file still had no GatewayUrl. Token length was 28 and BootstrapToken length was 28. The registry file had no gateway URLs and no active id. The root device key file was byte-for-byte unchanged.

Release signing for OpenClawCompanion-Setup-x64.exe runs only for a tag or promotion build in the release-signing environment, so this PC still has no signed installer of head 632aae78.

CI reconciliation

The first current-head CI run passed setup/connect, revocation recovery, tray/setup/integration, UI/accessibility, release publish, MSIX, and proof contracts. Its two failures were unrelated baseline flakes:

  • Shared test: PiperVoiceExtractionTests.ExtractTarBz2Async_CancellationIsBoundedAndKillsExtractor observed the fixture process still running.
  • Network recovery fixture: Gateway restart failed during setup with StateDatabaseCoordinatorContentionError and GATEWAY_RESTART_PREPARATION_REFUSED before either network recovery test executed.

Only the failed jobs were rerun.

@clawsweeper

clawsweeper Bot commented Sep 23, 2026 •

Copy link
Copy Markdown

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@clawsweeper clawsweeper Bot added 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. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Sep 23, 2026
@clawsweeper

clawsweeper Bot commented Sep 23, 2026 •

Copy link
Copy Markdown

Codex review: needs real behavior proof before merge.

What this changes

This PR removes legacy gateway tokens during uninstall and prevents URL-less credentials or retained identity from being assigned to the default gateway.

Example: Uninstall leaves a profile without GatewayUrl but with legacy tokens and a root device identity.

  • Before: A later launch can associate those credentials with ws://127.0.0.1:18789.
  • After: Uninstall removes the legacy token fields, and startup requires an explicitly saved destination before using retained identity.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) A useful, source-supported repair with production credential-boundary evidence, but incomplete installer lifecycle and persisted-state upgrade proof.
Proof confidence 🦐 gold shrimp (3/6) Real behavior proof is necessary before merge. See Before merge.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Bug fix · Worth it: Yes · Fix scope: Complete
User problem: Uninstall can leave credentials that a later launch assigns to an unintended default-port listener.
Reason: The source establishes the defect, and the maintainer explicitly approved withholding unattributable credentials and requiring reconnection.

Merge readiness

⛔ Blocked before merge - 2 items remain

Keep this PR open: it fixes a current-main credential-cleanup defect with approved product direction, and no new correctness defect was found.

Priority: P2
Reviewed head: e73588160336e49e875cca03593cb1d676381165

Before merge

  • Add real behavior proof - Supplied tray startup and MCP invocation traces at 632aae7 exercise an allowed saved listener and rejection before candidate/default-port I/O after a settings conflict; those owners remain unchanged at this head. The required installer lifecycle remains incomplete: the unsigned candidate never completed cleanup, signed alpha runs exercised older code, and inspected images show the earlier uninstall-choice flow. Coordinate the maintainer-scheduled pool to provide signed reviewed-head Windows lifecycle output showing actual token removal and preserved preferences/external gateway state, with IPs, API keys, tokens, phone numbers, and private endpoints redacted. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
  • 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.Tray.Tests/GatewayDirectConnectServiceTests.cs: Remove the added netstat counts and helper from Connect_FailureFromUrlLessProfile_DoesNotPersistSetupGateway: its mocked connection manager cannot exercise credential network I/O, so retain the useful persisted-state and resolver assertions.
  • Missing end-to-end proof: The supplied evidence does not complete signed reviewed-head Windows install, latest-stable upgrade, repair, uninstall, and relaunch with successful token removal and remaining state preserved.
Agent review details

How this fits together

Windows uninstall updates persisted tray settings; SettingsManager supplies credential-target provenance to startup, chat, and direct-connect rollback before gateway network I/O.

flowchart LR
 A[Windows uninstall] --> B[Persisted tray settings]
 B --> C[SettingsManager]
 C --> D[Explicit destination gate]
 E[Gateway registry and identity] --> D
 D --> F[Startup and chat consumers]
 F --> G[Gateway network I O]
Loading

Technical review

Best possible solution:

Land the approved credential cleanup after the required signed Windows lifecycle demonstrates successful removal and preservation of remaining settings.

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

Main's uninstall and credential-loading paths establish the residue-to-default-target failure; the supplied older signed-installer run also retained seeded tokens, but this review executed no reproduction.

Is this the best way to solve the issue?

Removing the residue and enforcing explicit destination provenance at its existing owners addresses the cause while preserving registry credentials and saved-URL compatibility.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 817b0b586c1e.

Provenance checked

Testing

Proof path: shipped entry point.

Security

None.

Evidence

What I checked:

Likely related people:

  • Scott Hanselman: Raw commit a861a65 adds src/OpenClaw.Tray.WinUI/Services/SettingsManager.cs:233 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: a861a658a71c; files: src/OpenClaw.Tray.WinUI/Services/SettingsManager.cs)
  • Barbara Kudiess: Raw commit 603886a adds src/OpenClaw.Tray.WinUI/Services/GatewayDirectConnectService.cs:506 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 603886a81d34; files: src/OpenClaw.Tray.WinUI/Services/GatewayDirectConnectService.cs)

Review metrics

Metric Value Why it matters
Change distribution Production/scripts +87/-31; tests +835/-18; docs +19/-0 Most growth exercises cleanup, saved-target compatibility, persistence conflicts, and rollback; socket-count plumbing in a mocked test adds little confidence.

Labels

Label changes:

No label changes.

Label justifications:

  • P2: A focused uninstall and legacy-profile repair addresses credential residue without an established widespread runtime outage.
  • merge-risk: 🚨 compatibility: Older URL-less profiles lose implicit credential reuse; the maintainer explicitly accepted reconnecting instead of guessing a destination.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🐚 platinum hermit.
  • status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask.

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Complete the signed reviewed-head installer lifecycle from the latest stable release, showing token removal and preservation of remaining gateway settings.

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 (20 earlier review cycles; latest 8 shown)
  • reviewed 2026-10-07T14:06:28.121Z sha 285346a :: needs real behavior proof before merge. :: [P1] [P1] Preserve explicit-target provenance through settings rollback
  • reviewed 2026-10-07T14:38:12.395Z sha 285346a :: needs real behavior proof before merge. :: [P1] [P1] Preserve explicit-target provenance through settings rollback
  • reviewed 2026-10-07T14:59:27.134Z sha 999a05c :: needs real behavior proof before merge. :: none
  • reviewed 2026-10-07T15:33:30.232Z sha 632aae7 :: needs real behavior proof before merge. :: none
  • reviewed 2026-10-07T15:55:28.281Z sha 632aae7 :: needs real behavior proof before merge. :: none
  • reviewed 2026-10-07T16:38:34.566Z sha 632aae7 :: needs real behavior proof before merge. :: none
  • reviewed 2026-10-09T01:01:08.936Z sha 632aae7 :: needs real behavior proof before merge. :: none
  • reviewed 2026-10-13T22:24:46.207Z sha 46ad84f :: needs real behavior proof before merge. :: none

Reviewed October 13, 2026, 6:44 PM ET / 22:44 UTC (Revision 21).

@karkarl

karkarl commented Sep 23, 2026

Copy link
Copy Markdown
Collaborator

Global triage: NEEDS_HUMAN_TEST. Take confidence 55%; recommendation confidence 85%; effort small; risk high.

Reviewed exact head 9ec7d05b0378. Direction is right and no correctness defect was found. Clarify and test that nulling legacy tokens affects interactive credential resolution in App and Chat, not only migration, and document that tokens are dropped even when preserveNodeSettings=true. The App.xaml.cs guard is redundant once SettingsManager enforces the invariant. Blocking gate is windows-clean-installer-upgrade: uninstall then relaunch plus upgrade from a pre-change profile, with closeout and Connection tests reported.

Uninstall drops gateway tokens even when node settings are preserved. Credential resolution for App and Chat now has a test for that cleared state, and the duplicate guard is gone where SettingsManager already enforces it.

Signed-off-by: Sebastien Tardif <[email protected]>
@clawsweeper clawsweeper Bot added the merge-risk: 🚨 security-boundary 🚨 Merging this PR could weaken sandboxing, authorization, credentials, or sensitive data. label Sep 23, 2026
@clawsweeper clawsweeper Bot added P1 Urgent regression or broken agent/channel workflow affecting real users now. and removed P2 Normal priority bug or improvement with limited blast radius. labels Sep 23, 2026
@shanselman shanselman added the status: 🚢 actively landing A maintainer or agent is actively driving this item through implementation, validation, or merge. label Sep 23, 2026
Co-authored-by: Copilot App <[email protected]>

Copilot-Session: a4fbf4c9-96de-4b6d-98bd-aa82320241a6
Remove legacy gateway fields in the production PowerShell reset independently of preserved node settings. Exercise only its real JSON/logging helpers under Windows PowerShell 5.1 with isolated fixtures, including leftover-token, clean-state, and write-failure cases.

Co-authored-by: Copilot App <[email protected]>

Copilot-Session: a4fbf4c9-96de-4b6d-98bd-aa82320241a6
Keep three distinct fake token values and the same runtime assertions while avoiding review-bundle secret-scanner false positives. No production behavior or review policy changes.

Co-authored-by: Copilot App <[email protected]>

Copilot-Session: a4fbf4c9-96de-4b6d-98bd-aa82320241a6
@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 Sep 24, 2026
@shanselman shanselman removed the status: 🚢 actively landing A maintainer or agent is actively driving this item through implementation, validation, or merge. label Sep 24, 2026
@SebTardif

Copy link
Copy Markdown
Contributor Author

@shanselman This pull stops loading a saved token when GatewayUrl is missing. The review on 329ea8e3 asks which of these should ship:

  1. A guided Connection step that shows the retained credential only after the user confirms the gateway.
  2. Leave the fail-closed load as it is, so an older profile with no URL has to be connected again by hand.

Which one do you want?

@shanselman shanselman added the status: 🚢 actively landing A maintainer or agent is actively driving this item through implementation, validation, or merge. label Sep 28, 2026
@shanselman

Copy link
Copy Markdown
Collaborator

Maintainer decision: choose 2, fail closed and reconnect explicitly.

A token left behind with no GatewayUrl is residue from the old uninstall bug, not a safely attributable connection. We should not redisplay it or bind it to a guessed/default gateway. The user should reconnect with a fresh setup code or explicitly supplied URL/token. If this state is surfaced in-product, the message should explain that previous credentials were cleared for safety and route to Connection, without exposing the retained token.

I am taking the original branch through current-main integration and validation. I will also verify the separate retained device-identity path cannot authorize an unintended default-port listener, and determine the strongest installer uninstall/upgrade proof this host can provide.

Co-authored-by: Copilot App <[email protected]>

Copilot-Session: 9ba54a2d-477b-4b8e-994c-5fb3755d8b01
Co-authored-by: Copilot App <[email protected]>

Copilot-Session: 9ba54a2d-477b-4b8e-994c-5fb3755d8b01
@shanselman

Copy link
Copy Markdown
Collaborator

@clawsweeper re-reviewnnMaintainer proof update: exact-head local runtime evidence and the clean Azure Windows installer/upgrade trace are now documented in the PR body, including the signed-current-artifact, AppX discovery, and stub WSL blockers. The two unrelated failed CI jobs have been rerun.

@clawsweeper

clawsweeper Bot commented Sep 28, 2026 •

Copy link
Copy Markdown

🦞👀
ClawSweeper assist is taking a look at your question.

I queued a lightweight read-only assist pass. It will post a separate answer comment and will not edit the durable ClawSweeper review comment or trigger close, merge, repair, label, or branch changes.

Request: re-reviewnnMaintainer proof update: exact-head local runtime evidence and the clean Azure Windows installer/upgrade trace are now documented in the PR body, including the signed-current-artifact, AppX discovery, and stub WSL blockers. The two unrelated failed CI jobs have been rerun.

@shanselman

Copy link
Copy Markdown
Collaborator

@clawsweeper re-review

Exact-head proof is now in the PR body. The two unrelated failed CI jobs are rerunning.

@clawsweeper

clawsweeper Bot commented Sep 28, 2026 •

Copy link
Copy Markdown

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper

clawsweeper Bot commented Sep 28, 2026

Copy link
Copy Markdown

ClawSweeper assist: The proof update is documented for head 29c83ff9, but this context cannot establish a new correctness review. The signed current installer proof remains blocked, and the rerun outcomes are not shown.

Evidence:

  • The PR body records local runtime proof and the Azure Windows trace, including the unsigned candidate, AppX discovery failure, and stub WSL.
  • The previous review predates that proof update.
  • The maintainer’s re-review request says the two failed CI jobs were rerun; their results are absent here.

Suggested next action: Check the rerun results and request the full current-head review with @clawsweeper review.


Source: #1481 (comment)
Assist reasoning: medium.

@shanselman

Copy link
Copy Markdown
Collaborator

CI reconciliation update: Core and CLI passed on rerun. Network recovery failed a second time before either test executed, again during shared setup fixture initialization with StateDatabaseCoordinatorContentionError and GATEWAY_RESTART_PREPARATION_REFUSED. This is unrelated to the uninstall/credential diff, but required CI remains red. I am pausing active landing rather than overriding the signed-current-artifact proof and branch-protection gates.

@shanselman shanselman removed the status: 🚢 actively landing A maintainer or agent is actively driving this item through implementation, validation, or merge. label Sep 28, 2026
…r-gateway-tokens

Signed-off-by: Sebastien Tardif <[email protected]>

# Conflicts:
#	src/OpenClaw.Tray.WinUI/Pages/ChatPage.xaml.cs
@clawsweeper clawsweeper Bot added P2 Normal priority bug or improvement with limited blast radius. and removed P1 Urgent regression or broken agent/channel workflow affecting real users now. labels Oct 7, 2026
…meout

ConnectNodeOnlyAsync gives the previous node disconnect two seconds. The test waited only three, so a busy runner timed out before the disconnect budget elapsed.

Signed-off-by: Sebastien Tardif <[email protected]>
A failed settings save restored the settings record but left the
explicit-target flag set, so the setup default looked like a saved
gateway. Direct-connect rollback snapshotted that same fallback and
could write it back. Both paths now keep an unsaved profile unsaved,
while a gateway the user already saved still restores.

The credential resolver returns no endpoint after either rollback, so
no credential-bearing request is built for the setup port. A saved
gateway still resolves.

Validation: build.ps1 succeeded. Shared tests passed 4263, skipped 33.
Tray tests passed 4016.

Signed-off-by: Sebastien Tardif <[email protected]>
A loopback listener accepted one TCP chat request for an explicitly
saved gateway. The request line was GET /chat with a token query.
After a failed save and a failed direct connect from a URL-less
profile, this process had no TCP connection to the setup port.

build.ps1 succeeded. Shared tests passed 4263, skipped 33.
Tray tests passed 4017.

Signed-off-by: Sebastien Tardif <[email protected]>
@clawsweeper clawsweeper Bot removed the merge-risk: 🚨 security-boundary 🚨 Merging this PR could weaken sandboxing, authorization, credentials, or sensitive data. label Oct 9, 2026
@karkarl

karkarl commented Oct 9, 2026

Copy link
Copy Markdown
Collaborator

Global triage: HOLD_FOR_AUTHOR. Take confidence 20%; recommendation confidence 98%; effort medium; risk high.

Reviewed exact head 632aae785f9c. GitHub currently reports CLEAN with 29 passing, 0 failing, and 0 pending checks. needs-proof label is present. Durable automated signal: Codex review: needs real behavior proof before merge..

Author: resolve the current durable review findings, add focused regressions, and request a fresh exact-head review.

This is a triage classification, not a merge action. No branch changes were made.

The only content conflict was the using list in
SettingsManagerIsolationTests. Keep this branch's socket usings and
main's MXC, test-support, and tray usings.

./build.ps1 exited 0. Shared tests: 4280 passed, 34 skipped. Tray
tests: 4025 passed.

Signed-off-by: Sebastien Tardif <[email protected]>
@clawsweeper

clawsweeper Bot commented Oct 13, 2026

Copy link
Copy Markdown

@clawsweeper re-reviewnnmaintainer proof update: exact-head local runtime evidence and the cl is retired; ClawSweeper now only reviews.

The Dev settings job compiles AppIdentity with DEV_BUILD, so the
default URL uses port 18790. The release job still uses 18789.
MissingGatewayUrl_DoesNotExposeLegacyTokensForDefaultUrl now expects
AppIdentity.SetupGatewayUrl.

That test passed for the release build and for DevBuild=true. The
other SettingsManagerIsolationTests passed under DevBuild=true.

Signed-off-by: Sebastien Tardif <[email protected]>
@karkarl

karkarl commented Oct 15, 2026

Copy link
Copy Markdown
Collaborator

Global triage: NEEDS_HUMAN_TEST. Take confidence 65%; recommendation confidence 96%; effort medium; risk high.

Reviewed exact head e73588160336. The merge/test delta is source-clear and exact-head checks are green. The signed lifecycle proof is still incomplete: the unsigned candidate did not complete cleanup, and signed alpha installers exercised older code.

Next: provide signed current-implementation install/upgrade/repair/uninstall/relaunch proof showing actual token removal while unrelated preferences and external-Gateway state remain intact. Also replace the remaining hard-coded fallback setup URL with the compiled identity in follow-up. No fixes or branch changes were made by this review.

Preserve gateway-target provenance and protected-secret reset behavior while retaining both uninstall regression test groups.

Co-authored-by: Copilot App <[email protected]>
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.

4 participants