Skip to content

fix(connection): Open Dashboard can send the token before the SSH forward owns the port - #1514

Open
SebTardif wants to merge 32 commits into
openclaw:mainfrom
SebTardif:fix/f104-dashboard-owned-ssh-forward
Open

SebTardif wants to merge 32 commits into
openclaw:mainfrom
SebTardif:fix/f104-dashboard-owned-ssh-forward

Conversation

@SebTardif

@SebTardif SebTardif commented Sep 24, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Open Dashboard could send a gateway token through an SSH forward that belonged to a different gateway, and it could drop that forward before the browser connected.

User Impact

The browser opens only when the gateway identity and SSH destination still match the ones checked before the wait. If a stop is already waiting before the browser is opened, the dashboard does not open and the stop finishes.

A saved gateway URL that names a remote host is left in settings. GatewayDashboardLauncher builds the browser URL. That URL keeps the saved mount path, query, and fragment, and uses the verified local forward for the host and port.

Before that URL is handed to the browser, this app binds both 127.0.0.1 and ::1 on the public port. SSH listens on a backend port. Guarded gateway clients use 127.0.0.1. If the tunnel already belongs to the connection manager, the replacement stays on that owner. Stop and Reset after the navigation is submitted end the SSH process and leave the public port occupied. Recovery drops the launch lease and can start SSH again on a backend port for the same user, host, remote port, and SSH port. A guard created for a start that fails before the browser opens is released.

Browser traffic is copied only when the accepted loopback socket belongs to that SSH process and the process start time still matches. Browser-proxy forwarding uses the saved local port. Local proxy ports 65534 and 65535 remain valid. The remote gateway port still has to leave room for the proxy's + 2.

A failed browser open shows the existing Connection notification and retry dialog. Retry keeps the requested path. A successful open dismisses that notification. The launch error is not written to the log, because the message can contain the token URL.

Switching to another saved SSH gateway that stores the same local port keeps the older dashboard port pinned to the first destination. The second gateway listens on a new runtime port. Its stored local port is not rewritten.

Why This Change Was Made

The ownership wait returns the generation, local port, and SSH process id that passed listener verification.

The public port has to be owned on every loopback address the client can select, before SSH exits and before the browser receives the URL. Manager-owned tunnels keep that owner. A failed start does not leave the new bind behind.

Dashboard URL construction and launch failure handling stay in GatewayDashboardLauncher.

Evidence

The ssh.exe session below is from parent 2a20af4a0d672d61fec4ba95d88d49a7c5bc119e. Head 6c7b974084eebd5f629fdf0baf2612b1cd008418 adds the second-gateway runtime port and was not part of that session. SshTunnelService.EnsureSettingsOwnedForwardReadyAsync started real ssh.exe to [email protected] port 22, with BatchMode and no password. The guest HTTP server listened on 127.0.0.1:19048. The owned forward was local port 19049, ssh pid 7580. GET /ocwn-1514?token=not-a-gateway-token returned HTTP 200. A browser opened that same URL. The guest log recorded token=true for those requests and did not store the query value. One later guest line was token=false, from a browser fetch that did not include the query.

A second call for remote port 19047 on the same local port returned owned=false. It did not replace the forward. Binding another listener on 19049 failed while the guard held it. The next request then failed with HttpRequestException. Calling ensure again for the original destination returned owned=true with a new ssh pid 43132, and the same GET returned HTTP 200.

A later run on the same head kept ssh pid 45824 as the recorded owner and pointed the backend port at a different process listening on 127.0.0.1:19046. The public GET failed. That other process accepted the TCP connection and read 0 bytes. The guest log did not record that request. Recovery then used ssh pid 36624 and the GET returned HTTP 200. The guest log for the whole run was two token=true lines, the allowed call and the recovered call.

The same head then covered a delayed navigation across explicit Stop and Reset. EnsureSettingsOwnedForwardReadyAsync used real ssh.exe to [email protected] port 22, local port 19149, remote port 19148. The first owned forward was ssh pid 48196, backend port 61404. GET /ocwn-1514?token=not-a-gateway-token returned HTTP 200. The guest log was one token=true line. Navigation was submitted on that handoff, then Stop ran. Status was Stopped, the public port stayed held, and a second bind of 19149 threw SocketException. The delayed GET failed with HttpRequestException. A foreign listener on backend port 61404 accepted 0 connections and read 0 bytes. The guest log did not gain a line. Ensure for the same destination then used ssh pid 39768, backend port 61409, and the GET returned HTTP 200. The guest log gained a second token=true line.

ResetNotConfigured used the same sequence. Navigation was submitted on ssh pid 39768. After reset, status was NotConfigured, port 19149 stayed held, and a second bind threw SocketException. The delayed GET failed. A foreign listener on backend port 61409 accepted 0 connections and read 0 bytes. The guest log stayed at two lines. Ensure for the same destination then used ssh pid 35880, backend port 61414, and the GET returned HTTP 200. The guest log gained a third token=true line.

A local port Dashboard has reserved stays tied to the original user, host, remote port, and SSH port. A different destination is not accepted on that same port. A second saved gateway that stores the same port gets a different runtime listener, and stopping that gateway does not release the first port.

Unit coverage on this head, from the earlier closeout:

Unit coverage on this head:

  • A manager-owned tunnel that is already running on the requested port stays manager-owned. A settings-owned tunnel stays settings-owned.
  • Holding the dashboard port rejects a second listener on 127.0.0.1 and on ::1. The guarded WebSocket host is 127.0.0.1.
  • Startup with SSH port 0 does not leave the public port bound.
  • Stop after a submitted navigation ends the planted SSH process and keeps the port bound.
  • A submitted navigation whose planted SSH process has exited drops the launch lease and keeps the port after Stop.
  • A different SSH port cannot reuse that hold.
  • Local port 65533 with browser-proxy forwarding emits proxy port 65535.
  • Two saved gateways that store one local port: the first destination stays pinned, and the second connect port is the allocated runtime port. Its browser-proxy port is neither the saved port nor the saved port plus 2.
  • Stopping the second gateway leaves the first dashboard port held and still pinned to the first destination. That test failed before the release filter.

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-winui-interactive: isolated Debug tray built from this head. Settings had EnableMcpServer true, EnableNodeMode false, and UseSshTunnel true with an empty user and host, so setup did not block and the tunnel settings were incomplete. openclaw://dashboard was forwarded on the isolated pipe. The log recorded SSH tunnel is enabled but settings are incomplete. The Connection page showed a dialog titled Dashboard, with the text "Dashboard could not open. Check the verified gateway connection, then try again." Retry and Close are both fully inside the window. Invoking Retry removed that button, and the same dialog returned about 200 ms later. The incomplete-tunnel warning was logged again.

Dashboard retry on the isolated tray

Validation

Head 6c7b974084eebd5f629fdf0baf2612b1cd008418.

  • ./build.ps1: exit 0
  • Shared: 4226 passed, 33 skipped, 0 failed
  • Tray: 3808 passed, 0 failed
  • SshTunnelServiceTests, DashboardBrowserHandoffTests, and GatewayClientEndpointResolverTests: 56 passed, 0 failed

Real behavior proof

  • Behavior or issue addressed: Claiming the dashboard port stopped a manager-owned tunnel and restarted it as a settings tunnel. The guard bound only 127.0.0.1, so ::1 on the same port stayed available. A failed start could also leave the new guard bound.
  • Real environment tested: Windows 11, worktree C:\Users\sebta\wt-wn-1514, head 2a20af4a0d672d61fec4ba95d88d49a7c5bc119e. Guest SSH is Ubuntu-24.04 on 127.0.0.1:22. The HTTP proof server was 127.0.0.1:19048 inside that guest.
  • Exact steps or command run after this patch: SshTunnelService.EnsureSettingsOwnedForwardReadyAsync for [email protected], local port 19049, remote port 19048. Then an HTTP GET and a browser open of http://127.0.0.1:19049/ocwn-1514?token=not-a-gateway-token. Then the same call with remote port 19047. Then ensure again for remote port 19048. On this same head, the delayed case used local port 19149 and remote port 19148: submit the navigation, call Stop, send the GET, then ensure the original destination. Repeat that with ResetNotConfigured. The isolated tray then received openclaw://dashboard.
  • Evidence after fix: owned forward ssh pid 7580 returned HTTP 200. The changed destination returned owned=false. A second bind of 19049 was denied. Recovery used ssh pid 43132 and returned HTTP 200. On the next run, ssh pid 45824 stayed the recorded owner while a different process listened on the backend port. That process read 0 bytes and the guest did not see the request. Recovery used ssh pid 36624 and returned HTTP 200. After Stop, ssh pid 48196 was gone, the delayed GET failed, and the foreign listener on backend port 61404 read 0 bytes. Recovery ssh pid 39768 returned HTTP 200. After Reset, the foreign listener on backend port 61409 read 0 bytes. Recovery ssh pid 35880 returned HTTP 200. The isolated tray dialog is the screenshot above. Retry left and then returned.
  • Observed result after fix: Credential-bearing bytes were forwarded only through the owned ssh process. A different SSH destination did not take over that local port. A backend socket owned by another process received no request bytes. A GET that arrived after explicit Stop or Reset was not delivered, and the same destination worked again after recovery. The tray shows the failure dialog and opens it again when Retry is invoked.
  • What was not tested: Two saved SSH gateways were not switched in the tray, and the new runtime port was not opened with ssh.exe or a browser. The port choice and the stop are covered by the unit tests above. The ssh.exe and tray dialog evidence is from parent 2a20af4a.

Security Impact

  • New permissions or capabilities? No
  • Secrets or tokens handling changed? Yes
  • New or changed network calls? No
  • Command or tool execution surface changed? No
  • Data access scope changed? No
  • If any answer is Yes, explain the risk and mitigation: The shared token is appended only when the gateway identity and SSH destination still match the snapshot checked before the wait. This app binds 127.0.0.1 and ::1 before the URL is issued and keeps that binding after SSH stops. Guarded clients use 127.0.0.1. Forwarding happens only when the accepted loopback socket belongs to the SSH process for the original user, host, remote port, and SSH port. Launch failures are not logged, because the exception text can contain the token URL.

Compatibility and Migration

  • Backward compatible? Yes
  • Config or environment changes? No
  • Migration needed? No

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.

Open Dashboard marked the tunnel up as soon as ssh.exe started, then put
the shared token in the browser URL. Wait for the same listener ownership
check StartOwnedAsync uses, and do not build that URL when the wait fails.

- Add EnsureSettingsOwnedForwardReadyAsync for the settings-owned forward
- Stop the forward and show the existing tunnel toast when ownership fails
- Leave direct dashboard opens unchanged when SSH is off

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

clawsweeper Bot commented Sep 24, 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 P1 Urgent regression or broken agent/channel workflow affecting real users now. merge-risk: 🚨 availability 🚨 Merging this PR could cause crashes, hangs, restart loops, stalls, or process outages. merge-risk: 🚨 security-boundary 🚨 Merging this PR could weaken sandboxing, authorization, credentials, or sensitive data. 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 24, 2026
@clawsweeper

clawsweeper Bot commented Sep 24, 2026 •

Copy link
Copy Markdown

Codex review: needs real behavior proof before merge.

What this changes

This PR waits for SSH listener ownership before opening Dashboard and retains browser endpoints across tunnel shutdown and saved-gateway switching.

Example: An SSH gateway saves ws://gateway.example:18789/mount/ with local forward port 19049.

  • Before: Dashboard uses the saved origin without waiting for ownership of the forward.
  • After: Dashboard targets 127.0.0.1:19049 after ownership verification and attempts to protect that endpoint after SSH stops.

Review scores

Measure Result What it means
Overall readiness 🧂 unranked krab (1/6) Useful parent-head SSH and visible UI evidence support the repair, but current-head credential-exposure and connection defects prevent landing.
Proof confidence 🦐 gold shrimp (3/6) Real behavior proof is necessary before merge. See Before merge.
Patch quality 🧂 unranked krab (1/6) Security review found an item that needs attention.

Product

Kind: Bug fix · Worth it: Yes · Fix scope: Complete
User problem: Opening Dashboard for an SSH gateway can authenticate against an unintended endpoint before the intended forward owns its listener.
Reason: This is a concrete credential-safety repair, and collaborator direction already approves preserving endpoint protection while retaining saved-gateway switching.

Merge readiness

⛔ Blocked before merge - 19 items remain

Keep this PR open: main still needs the Dashboard credential-safety repair, but credential routing and SSH lifecycle defects block merge.

Priority: P1
Reviewed head: 2651ebd346fca2abeed4bce617fe153e930865e3

Before merge

  • Add real behavior proof - Authority-chain proof required: the parent-head Windows ssh.exe results show allowed forwarding, foreign-backend rejection and delayed-request rejection after one Stop or Reset, and the inspected screenshot shows the retry dialog. Supply current-head redacted logs, live output or a recording through the production owners showing saved-gateway relocation, connected-client continuity, and zero credential-bearing effects after stale binding, teardown admission, repeated teardown or a foreign saved-proxy listener; include existing saved profiles from the latest stable release and redact credentials, IPs 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.
  • Bind the token and SSH destination to one active gateway record (P1) - After switching saved gateway A to B, SwitchGatewayAsync updates the registry without synchronizing global SSH settings. These captures can therefore agree on B's identity and token paired with A's SSH destination, pass SameBinding, and project B's credential-bearing URL onto A's forward. Capture and revalidate the tunnel configuration from the same registry record as the credential.
  • Use the runtime endpoint for authorization and network I/O (P1) - With A pinned on saved port 19049, B can relocate its gateway/proxy listeners to 45111/45113. NodeService and BrowserControlEndpoint still send browser.proxy requests to saved port 19051, while this translation verifies ownership of 45113. App's authorization can therefore succeed for a different socket destination, allowing a foreign listener on 19051 to receive B's bearer token. Publish record-bound runtime endpoints to consumers and verify the exact endpoint used for I/O; GatewayClientEndpointResolver also still returns the saved endpoint.
  • Close navigation admission before capturing teardown protection (P1) - Teardown releases _stateLock after capturing protectedPorts and only later cancels handoffs. An existing unsubmitted handoff can begin and submit navigation in that gap. Teardown then uses the earlier empty snapshot and releases stoppedPort, allowing a replacement listener to serve the pending browser URL. Close admission and capture protection atomically, with a barrier-controlled regression.
  • Retain issued-navigation protection across backend generations (P1) - The first manager teardown retains the guard but clears the handoffs and removes its durable protection marker here. After a same-destination StartOwnedAsync without another Dashboard open, a second teardown sees no protected ports and releases the public listener while the original browser navigation may still be pending. Preserve the obligation across generations and cover submit, stop, restart, second stop, then delayed navigation.
  • Coordinate Dashboard replacement through the connection manager (P1) - Opening Dashboard on a connected, unguarded SSH forward stops its process here and starts a new generation behind the guard. Keeping GatewayConnectionManager as the owner enum does not update existing client proofs: AuthorizeCredentialHandoffAsync rejects the replacement against the captured preflight generation. Coordinate client retirement and fresh authorization through the manager so opening Dashboard does not break operator/node reconnect.
  • Guard the relocated Dashboard endpoint before issuing its URL (P1) - When the saved port is pinned to A, this plan gives B the same runtime port for client connections and the direct SSH bind. ClaimDashboardPublicPort examines only the saved port, so B's runtime Dashboard endpoint has no guard. After navigation submission, Stop, Reset and TeardownLocked call Hold on that occupied runtime port before killing SSH; binding throws and prevents shutdown. Give the relocated browser endpoint guarded public/backend separation before issuing its URL.
  • Separate endpoint protection from replacement-blocking leases (P1) - Production passes consumptionProbe:null, so a successful Dashboard open retains its lease while SSH runs. Changing browser-proxy forwarding and reconnecting reaches this different-spec refusal. ReconnectAsync has already retired the clients without stopping the tunnel, leaving the user disconnected. Keep durable endpoint protection independently of the replacement-admission lease and cover ordinary same-gateway reconfiguration.
  • Release an unsubmitted guard after natural SSH startup exit (P2) - If ssh.exe exits during readiness, its exit callback clears _process. This catch classifies the attempt as no longer current and returns before ReleaseUnsubmittedGuard. Without submitted navigation, the exit callback also performs no guard cleanup, leaving the failed attempt's port reserved and destination-pinned. Distinguish natural exit from a superseding attempt and release only the failed attempt's unused guard.
  • Keep ordinary browser launches behind DashboardBrowser (P2) - With OPENCLAW_GATEWAY_FIXTURE enabled and SSH disabled, this branch calls Process.Start through DashboardBrowserShell instead of the existing DashboardBrowser owner. It opens the fixture URL in Windows, bypasses redacted suppression, and ignores the simulated failure marker. This also violates the explicit app-dashboard-launch-closed ledger boundary, and the modified source guard now checks only the setup path. Wrap the shell launch with DashboardBrowser for ordinary opens as well.
  • Select the browser scheme from the forwarded transport (P2) - A saved wss://gateway.example URL can describe the public TLS endpoint while SSH forwards the Gateway's plain HTTP port 18789. The retained live trace in fix(connection): open the dashboard on the tunnel, not the saved URL #1484 documents exactly this case: HTTP on the forward returned 200 and HTTPS returned no status. Copying the saved scheme here produces https://127.0.0.1:&lt;port>, so ownership succeeds but Dashboard cannot load. Use the forwarded transport's browser scheme without disabling certificate validation for TLS endpoints.
  • Isolate process-wide guard ports across parallel tests (P2) - This test holds the process-wide guard on 45678, while GatewayClientEndpointResolverTests.Resolve_UsesLocalForwardForTunnelBackedRecord in another default-parallel class expects that port to resolve to localhost. While held, the resolver returns 127.0.0.1, making the assertion order-dependent. Allocate isolated ports or serialize the guard-dependent tests.
  • Remove the unused browser-consumption inspection machinery (P2) - Production always supplies a null consumption probe, and repository-wide references show no production caller for HasEstablishedLoopbackConnection or the unseen-browser-use classifiers. Their scanner and browser-identity bookkeeping therefore add a parallel mechanism that no Dashboard launch uses. Remove the orphaned machinery and its tests while retaining TryConfirmAcceptedLoopbackOwner, which the relay actually needs. This production-growth concern was already visible at the previous reviewed head and was missed as a finding then; the file is unchanged.
  • Give the binding-change refusal a localized next action (P3) - When the gateway changes during the ownership wait, this path suppresses the launcher's retry dialog by returning FailedVisible, but the hardcoded English toast only states what happened. Tell the user to select the intended connection and retry Dashboard, using native resources across supported languages as required by AGENTS.md.
  • Resolve security concern: Wrong Gateway can receive browser authentication - The authorized principal is the registry Gateway whose credential was selected; ownership of a different globally configured SSH destination does not authorize exporting that credential.
  • Resolve security concern: Pending navigation can outlive endpoint protection - A replacement listener can serve a page that reads the URL-fragment token, even though that token is absent from the HTTP request target.
  • Resolve security concern: Runtime proof can authorize an unowned proxy destination - Browser-proxy authentication enters HTTP Authorization headers, so verifying a different runtime listener does not protect the final request to the saved port.
  • Explain or restore the original intent of Manager-owned SSH authorization - a51029e: fix: bind SSH credential handoffs to owned listeners #1126 binds credentials to exact manager, registry, tunnel and socket generations; retaining an owner enum does not explain replacing the generation outside that lifecycle.
  • Explain or restore the original intent of Final browser dispatch and fixture suppression - 4db2960: DashboardBrowser suppresses Windows launches under the Gateway fixture and owns its simulated failure path; this PR gives no reason for bypassing that owner on ordinary Dashboard opens.

Findings

  • [P1] Bind the token and SSH destination to one active gateway record — src/OpenClaw.Tray.WinUI/App.xaml.cs:4134-4136
  • [P1] Use the runtime endpoint for authorization and network I/O — src/OpenClaw.Connection/SshTunnelService.cs:1457-1460
  • [P1] Close navigation admission before capturing teardown protection — src/OpenClaw.Connection/SshTunnelService.cs:1576-1582
  • [high] Wrong Gateway can receive browser authentication — src/OpenClaw.Tray.WinUI/App.xaml.cs:4134
  • [high] Pending navigation can outlive endpoint protection — src/OpenClaw.Connection/SshTunnelService.cs:1587
  • [high] Runtime proof can authorize an unowned proxy destination — src/OpenClaw.Connection/SshTunnelService.cs:1459

Provenance

  • Manager-owned SSH authorization changes intended behavior without addressing why it exists (a51029e: fix: bind SSH credential handoffs to owned listeners #1126 binds credentials to exact manager, registry, tunnel and socket generations; retaining an owner enum does not explain replacing the generation outside that lifecycle.)
  • Final browser dispatch and fixture suppression changes intended behavior without addressing why it exists (4db2960: DashboardBrowser suppresses Windows launches under the Gateway fixture and owns its simulated failure path; this PR gives no reason for bypassing that owner on ordinary Dashboard opens.)

Tests

  • Low-value test tests/OpenClaw.Connection.Tests/WindowsTcpListenerSnapshotTests.cs: Remove the added established-use classifier tests with their unused production helpers; production supplies a null consumption probe.
  • Low-value test tests/OpenClaw.Connection.Tests/SshTunnelServiceTests.cs: Stop_DuringBrowserHandoff_CancelsTheHoldAndStops and StopDuringBrowserHandoff_DoesNotWaitForBrowserTraffic duplicate the same unsubmitted-stop case; remove the redundant test.
  • Low-value test tests/OpenClaw.Connection.Tests/SshTunnelServiceTests.cs: The browser-identity field assertions test stored values that production never uses to settle a handoff; remove those assertions with the unused state.
  • Missing end-to-end proof: Current-head proof does not cover relocated gateway/proxy traffic, connected-client continuity, stale-settings binding, teardown admission or repeated manager teardown, and base-failing/head-passing regressions for those failures are not shown.
Agent review details

How this fits together

GatewayDashboardLauncher receives registry credentials and an SSH endpoint, then submits a browser URL; GatewayConnectionManager separately owns operator and node connection authorization.

flowchart LR
  A[Dashboard action] --> B[Registry credentials]
  B --> C[Dashboard launcher]
  D[Connection manager] --> E[SSH tunnel service]
  C --> E
  C --> F[Browser]
  F --> G[Loopback guard]
  G --> E
  E --> H[Remote Gateway]
Loading

Technical review

Best possible solution:

Keep Dashboard dispatch in its existing owners and let GatewayConnectionManager coordinate one record-bound runtime endpoint with matching authorization, network routing, and durable browser protection.

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

Current-main source establishes the missing owned-forward browser binding, and current-head callers establish the reported failure paths; no target code or tests were executed during this review.

Is this the best way to solve the issue?

Owned local navigation is necessary, but the patch must preserve manager generations, use the actual runtime destination for every credential-bearing request, and retain the existing browser isolation owner.

Full review comments:

  • [P1] Bind the token and SSH destination to one active gateway record — src/OpenClaw.Tray.WinUI/App.xaml.cs:4134-4136
    After switching saved gateway A to B, SwitchGatewayAsync updates the registry without synchronizing global SSH settings. These captures can therefore agree on B's identity and token paired with A's SSH destination, pass SameBinding, and project B's credential-bearing URL onto A's forward. Capture and revalidate the tunnel configuration from the same registry record as the credential.
    Confidence: 0.99
  • [P1] Use the runtime endpoint for authorization and network I/O — src/OpenClaw.Connection/SshTunnelService.cs:1457-1460
    With A pinned on saved port 19049, B can relocate its gateway/proxy listeners to 45111/45113. NodeService and BrowserControlEndpoint still send browser.proxy requests to saved port 19051, while this translation verifies ownership of 45113. App's authorization can therefore succeed for a different socket destination, allowing a foreign listener on 19051 to receive B's bearer token. Publish record-bound runtime endpoints to consumers and verify the exact endpoint used for I/O; GatewayClientEndpointResolver also still returns the saved endpoint.
    Confidence: 0.99
  • [P1] Close navigation admission before capturing teardown protection — src/OpenClaw.Connection/SshTunnelService.cs:1576-1582
    Teardown releases _stateLock after capturing protectedPorts and only later cancels handoffs. An existing unsubmitted handoff can begin and submit navigation in that gap. Teardown then uses the earlier empty snapshot and releases stoppedPort, allowing a replacement listener to serve the pending browser URL. Close admission and capture protection atomically, with a barrier-controlled regression.
    Confidence: 0.99
  • [P1] Retain issued-navigation protection across backend generations — src/OpenClaw.Connection/SshTunnelService.cs:1586-1587
    The first manager teardown retains the guard but clears the handoffs and removes its durable protection marker here. After a same-destination StartOwnedAsync without another Dashboard open, a second teardown sees no protected ports and releases the public listener while the original browser navigation may still be pending. Preserve the obligation across generations and cover submit, stop, restart, second stop, then delayed navigation.
    Confidence: 0.99
  • [P1] Coordinate Dashboard replacement through the connection manager — src/OpenClaw.Connection/SshTunnelService.cs:1323-1324
    Opening Dashboard on a connected, unguarded SSH forward stops its process here and starts a new generation behind the guard. Keeping GatewayConnectionManager as the owner enum does not update existing client proofs: AuthorizeCredentialHandoffAsync rejects the replacement against the captured preflight generation. Coordinate client retirement and fresh authorization through the manager so opening Dashboard does not break operator/node reconnect.
    Confidence: 0.99
  • [P1] Guard the relocated Dashboard endpoint before issuing its URL — src/OpenClaw.Connection/SshTunnelService.cs:1424
    When the saved port is pinned to A, this plan gives B the same runtime port for client connections and the direct SSH bind. ClaimDashboardPublicPort examines only the saved port, so B's runtime Dashboard endpoint has no guard. After navigation submission, Stop, Reset and TeardownLocked call Hold on that occupied runtime port before killing SSH; binding throws and prevents shutdown. Give the relocated browser endpoint guarded public/backend separation before issuing its URL.
    Confidence: 0.99
  • [P1] Separate endpoint protection from replacement-blocking leases — src/OpenClaw.Connection/SshTunnelService.cs:250-251
    Production passes consumptionProbe:null, so a successful Dashboard open retains its lease while SSH runs. Changing browser-proxy forwarding and reconnecting reaches this different-spec refusal. ReconnectAsync has already retired the clients without stopping the tunnel, leaving the user disconnected. Keep durable endpoint protection independently of the replacement-admission lease and cover ordinary same-gateway reconfiguration.
    Confidence: 0.99
  • [P2] Release an unsubmitted guard after natural SSH startup exit — src/OpenClaw.Connection/SshTunnelService.cs:865-868
    If ssh.exe exits during readiness, its exit callback clears _process. This catch classifies the attempt as no longer current and returns before ReleaseUnsubmittedGuard. Without submitted navigation, the exit callback also performs no guard cleanup, leaving the failed attempt's port reserved and destination-pinned. Distinguish natural exit from a superseding attempt and release only the failed attempt's unused guard.
    Confidence: 0.99
  • [P2] Keep ordinary browser launches behind DashboardBrowser — src/OpenClaw.Tray.WinUI/App.xaml.cs:4192-4193
    With OPENCLAW_GATEWAY_FIXTURE enabled and SSH disabled, this branch calls Process.Start through DashboardBrowserShell instead of the existing DashboardBrowser owner. It opens the fixture URL in Windows, bypasses redacted suppression, and ignores the simulated failure marker. This also violates the explicit app-dashboard-launch-closed ledger boundary, and the modified source guard now checks only the setup path. Wrap the shell launch with DashboardBrowser for ordinary opens as well.
    Confidence: 1
  • [P2] Select the browser scheme from the forwarded transport — src/OpenClaw.Connection/DashboardBrowserHandoff.cs:52-54
    A saved wss://gateway.example URL can describe the public TLS endpoint while SSH forwards the Gateway's plain HTTP port 18789. The retained live trace in fix(connection): open the dashboard on the tunnel, not the saved URL #1484 documents exactly this case: HTTP on the forward returned 200 and HTTPS returned no status. Copying the saved scheme here produces https://127.0.0.1:&lt;port>, so ownership succeeds but Dashboard cannot load. Use the forwarded transport's browser scheme without disabling certificate validation for TLS endpoints.
    Confidence: 0.97
  • [P2] Isolate process-wide guard ports across parallel tests — tests/OpenClaw.Connection.Tests/SshTunnelServiceTests.cs:710-711
    This test holds the process-wide guard on 45678, while GatewayClientEndpointResolverTests.Resolve_UsesLocalForwardForTunnelBackedRecord in another default-parallel class expects that port to resolve to localhost. While held, the resolver returns 127.0.0.1, making the assertion order-dependent. Allocate isolated ports or serialize the guard-dependent tests.
    Confidence: 0.99
  • [P2] Remove the unused browser-consumption inspection machinery — src/OpenClaw.Connection/WindowsTcpListenerSnapshot.cs:42-46
    Production always supplies a null consumption probe, and repository-wide references show no production caller for HasEstablishedLoopbackConnection or the unseen-browser-use classifiers. Their scanner and browser-identity bookkeeping therefore add a parallel mechanism that no Dashboard launch uses. Remove the orphaned machinery and its tests while retaining TryConfirmAcceptedLoopbackOwner, which the relay actually needs. This production-growth concern was already visible at the previous reviewed head and was missed as a finding then; the file is unchanged.
    Confidence: 0.99
    Late finding: first raised on code an earlier review cycle already covered.
  • [P3] Give the binding-change refusal a localized next action — src/OpenClaw.Tray.WinUI/App.xaml.cs:4159-4162
    When the gateway changes during the ownership wait, this path suppresses the launcher's retry dialog by returning FailedVisible, but the hardcoded English toast only states what happened. Tell the user to select the intended connection and retry Dashboard, using native resources across supported languages as required by AGENTS.md.
    Confidence: 0.98

Overall correctness: patch is incorrect
Overall confidence: 0.99

AGENTS.md: found and applied where relevant.

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

Provenance checked

  • HTTP credential selection keeps the original intent (ef0240f: fix: setup flow, connection page, and chat token bugs #305 established shared-first HTTP credentials because device tokens authenticate WebSocket clients.)
  • Dashboard URL construction and visible failure keeps the original intent (3eed1f1: The onboarding change placed ordinary URL construction and retry handling in GatewayDashboardLauncher.)
  • SSH replacement and endpoint lifetime changes intended behavior with a stated reason (1d83639: The original SSH feature allowed later configurations to replace the forward; this PR explains retaining issued browser endpoints to prevent replacement listeners receiving pending navigation.)
  • Browser-proxy forwarding changes intended behavior with a stated reason (48387bd: The original proxy forward uses the local gateway port plus two; runtime relocation serves the approved shared-port repair, but existing consumers still use the saved endpoint.)

Testing

Proof path: shipped entry point.

Security

Needs attention: Credential binding, endpoint retention and relocated-port authorization can expose authentication to unintended destinations.

Evidence

Security concerns:

  • [high] Wrong Gateway can receive browser authentication — src/OpenClaw.Tray.WinUI/App.xaml.cs:4134
    The authorized principal is the registry Gateway whose credential was selected; ownership of a different globally configured SSH destination does not authorize exporting that credential.
    Confidence: 0.99
  • [high] Pending navigation can outlive endpoint protection — src/OpenClaw.Connection/SshTunnelService.cs:1587
    A replacement listener can serve a page that reads the URL-fragment token, even though that token is absent from the HTTP request target.
    Confidence: 0.99
  • [high] Runtime proof can authorize an unowned proxy destination — src/OpenClaw.Connection/SshTunnelService.cs:1459
    Browser-proxy authentication enters HTTP Authorization headers, so verifying a different runtime listener does not protect the final request to the saved port.
    Confidence: 0.99

What I checked:

Likely related people:

  • Scott Hanselman: Raw commit a51029e adds src/OpenClaw.Connection/SshTunnelService.cs:637 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: a51029ef6f77; files: src/OpenClaw.Connection/SshTunnelService.cs)
  • Sebastien Tardif: Raw commit d0c8b32 adds src/OpenClaw.Shared/SshTunnelCommandLine.cs:93 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: d0c8b32086ed; files: src/OpenClaw.Shared/SshTunnelCommandLine.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
Production and test changes Production +2,182/-109 lines; tests and test project +1,113/-14 lines The relay and lifecycle expansion serves a real security invariant, but includes unused consumption machinery and misses connected-client and repeated-teardown coverage.

Root-cause cluster

Relationship: canonical
Canonical: #1514
Summary: This PR remains the open repair for Dashboard transport ownership; the earlier alternative was closed unmerged and port validation does not solve browser handoff.

Members:

Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.

Labels

Label changes:

No label changes.

Label justifications:

  • P1: The Dashboard action needs a credential-safety repair, and the patch contains reachable credential-exposure and SSH connection failures.
  • merge-risk: 🚨 security-boundary: Gateway binding, released browser endpoints and runtime-versus-saved-port authorization can expose authentication to unintended listeners.
  • merge-risk: 🚨 availability: Dashboard replacement invalidates manager proofs, retained leases block reconfiguration, and relocated endpoints can prevent tunnel shutdown.
  • merge-risk: 🚨 compatibility: Existing saved profiles and endpoint consumers still use persisted ports while the new tunnel path can publish different runtime ports.
  • rating: 🧂 unranked krab: Overall readiness is 🧂 unranked krab; proof is 🦐 gold shrimp and patch quality is 🧂 unranked krab.
  • 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 (34 earlier review cycles; latest 8 shown)
  • reviewed 2026-10-02T16:09:50.221Z sha 99f5016 :: needs real behavior proof before merge. :: [P1] Preserve manager ownership when claiming the Dashboard port | [P1] Verify the public loopback route as well as the SSH backend | [P2] Release newly acquired guards when startup fails before handoff
  • reviewed 2026-10-02T16:40:23.107Z sha 2a20af4 :: needs real behavior proof before merge. :: none
  • reviewed 2026-10-06T07:06:08.147Z sha 2a20af4 :: needs real behavior proof before merge. :: none
  • reviewed 2026-10-06T07:21:48.735Z sha 2a20af4 :: needs real behavior proof before merge. :: none
  • reviewed 2026-10-06T07:49:30.823Z sha 2a20af4 :: needs real behavior proof before merge. :: none
  • reviewed 2026-10-06T08:21:54.936Z sha 2a20af4 :: blocked before merge. :: none
  • reviewed 2026-10-24T10:10:14.363Z sha 2a20af4 :: needs real behavior proof before merge. :: [P1] Bind the token and SSH destination to one active gateway record | [P1] Coordinate Dashboard tunnel replacement through the connection manager | [P1] Close navigation admission before capturing teardown protection | [P1] Retain issued-navigation protection across backend generations | [P1] Preserve switching between saved gateways sharing a local port | [P1] Separate durable endpoint protection from replacement-blocking leases
  • reviewed 2026-11-07T16:48:16.674Z sha 6c7b974 :: needs real behavior proof before merge. :: [P1] Bind the token and SSH destination to one active gateway record | [P1] Coordinate Dashboard replacement through the connection manager | [P1] Close navigation admission before capturing teardown protection | [P1] Retain issued-navigation protection across backend generations | [P1] Use the runtime endpoint for authorization and network I/O | [P1] Guard the relocated Dashboard endpoint before issuing its URL

Reviewed November 7, 2026, 12:02 PM ET / 17:02 UTC (Revision 35).

@karkarl

karkarl commented Sep 25, 2026

Copy link
Copy Markdown
Collaborator

Global triage: HOLD_FOR_AUTHOR. Take confidence 10%; recommendation confidence 97%; effort medium; risk high.

Two handoff races block this exact head:

  1. Dashboard tunnel ownership is reduced to a point-in-time Boolean. The verified process and generation are discarded before credential resolution and browser launch, so a concurrent tunnel stop or replacement can put another localhost listener behind a page whose fragment contains the shared token.
  2. When an older waiter detects replacement, StopIfCurrent preserves the newer process, but the catch path unconditionally writes LastError and Status=Failed, exposing a running replacement tunnel as failed.

Please carry a generation-bound ownership lease through browser launch, prevent replacement during that handoff, and guard failure-state updates by the captured process/generation. Add overlapping-attempt and replacement-before-launch regressions.

Run windows-winui-interactive with the isolated current-head app and prove real ssh.exe ownership before launch, no browser/network effect on port conflict, and no launch after ownership replacement. Required build, Shared, Tray, and rubber-duck closeout are also missing from the body.

The E2E setup refusals appear shared/baseline; the UI lane timed out and remains unresolved. CI Gate is derivative, so the required current-head proof is not green.

@shanselman shanselman added the status: 🚢 actively landing A maintainer or agent is actively driving this item through implementation, validation, or merge. label Sep 25, 2026
Co-authored-by: Copilot App <[email protected]>

Copilot-Session: 0f6d0b3f-48b9-489e-a9dd-a736c63d485b
Resolve the dashboard credential and endpoint from one immutable gateway snapshot, preserve newer tunnel state when an older ownership wait fails, and revalidate the exact tunnel generation at browser handoff.

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

Copilot-Session: 0f6d0b3f-48b9-489e-a9dd-a736c63d485b
@shanselman

Copy link
Copy Markdown
Collaborator

@clawsweeper re-review

Current head 6649c8b fixes the endpoint snapshot mismatch, preserves newer tunnel state, and holds a generation-bound owned-listener lease through browser handoff. Full local build plus Shared, Tray, and Connection suites pass. The PR body now includes current-head isolated WinUI/MCP/browser proof and the explicit live-SSH blocker.

@clawsweeper

clawsweeper Bot commented Sep 25, 2026 •

Copy link
Copy Markdown

🦞👀
Exact review queued.

Re-review progress:

@shanselman shanselman removed the status: 🚢 actively landing A maintainer or agent is actively driving this item through implementation, validation, or merge. label Sep 25, 2026
Restore PR openclaw#1514 to SebTardif's original four-file patch after the maintainer repair exceeded the bounded review scope.

This reverts commit 6649c8b.

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

Copilot-Session: 0f6d0b3f-48b9-489e-a9dd-a736c63d485b
@clawsweeper clawsweeper Bot added rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. and removed rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. labels Sep 25, 2026
The listener check returned before the shared-token URL was handed
to the browser, and an older wait wrote Failed onto a replacement
tunnel. Dashboard launch now keeps the generation from the ready
check and refuses to start the browser if that generation is no
longer the settings-owned forward. A wait that has already lost
the process does not publish failure.

Tests: EnsureSettingsOwnedForwardReadyAsync 2 passed. Dashboard
contract tests 2 passed. ./build.ps1 exit 0. Shared 4107 passed,
32 skipped. Tray 3116 passed.

Signed-off-by: Sebastien Tardif <[email protected]>
A manager-owned tunnel was rejected even when it was the verified
forward. The failure flag was written after the ownership lock was
released, so an older wait could mark a replacement failed. Open
Dashboard now accepts a settings or manager owner, requires the
dashboard URL to use that local port, and keeps the process alive
until the browser launch returns.

Tests: EnsureSettingsOwnedForwardReadyAsync 2 passed. Dashboard
contract test passed. ./build.ps1 exit 0. Shared 4107 passed, 32
skipped. Tray 3116 passed.

Signed-off-by: Sebastien Tardif <[email protected]>
A stop during the browser handoff used to return and let a later
start publish a new process over the old listener. A different
tunnel spec now fails while that handoff is active, and the old
process stays the tracked one. Ending the handoff no longer stops
the forward, so the port stays up after the browser is launched.

Tests: SshTunnel 67 passed. ./build.ps1 exit 0. Shared 4107 passed,
32 skipped.

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

A handoff could make StopLocked return while the caller still replaced the tunnel, and StopIfOwnedAsync reported that deferred stop as complete.

Signed-off-by: Sebastien Tardif <[email protected]>
@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 Sep 28, 2026
…f ends

A stop or reset during a browser handoff was dropped, so the forward stayed up after the launch and a reset could report NotConfigured while the process was still running.

Signed-off-by: Sebastien Tardif <[email protected]>
…e browser connects

Open Dashboard waited for one SSH forward, then read the active gateway again. A different gateway on the same local port could send its token through the forward that had just been checked. The launch now keeps one gateway identity, tunnel destination, and token snapshot through that wait and the browser handoff. A token rotation on that same gateway and destination still opens.

Process.Start returns before the browser connects. A stop recorded during launch used to run as soon as the handoff method finished, which freed the port while the browser still held the token URL. A stop that is already waiting skips the launch and completes. A stop that arrives during launch keeps the listener until an established loopback connection uses the forward, or until ssh exits. If that connection does not show up, the listener stays up.

Signed-off-by: Sebastien Tardif <[email protected]>
@clawsweeper clawsweeper Bot added rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. and removed rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. labels Sep 29, 2026
Core and CLI failed only WaitForOperatorHandshakeAsync_ReturnsTrue_WhenStateEventFires. The wait returned false after 934 ms. That test is not in this change, and it passed locally in 14 ms. The SSH handoff tests in the same job passed.

Signed-off-by: Sebastien Tardif <[email protected]>
The dashboard snapshot read the active gateway again after resolving
the token, so a switch could pair one gateway's token with another's
identity. The browser lease and a deferred stop are now decided under
one lock. An established loopback connection releases that stop only
when it is new for this handoff and, for an accepted socket, owned by
the SSH process.

Validation: ./build.ps1 exit 0. Shared 4107 passed, 32 skipped.
Tray 3116 passed. Connection SSH and TCP snapshot tests passed 40.

Signed-off-by: Sebastien Tardif <[email protected]>
@clawsweeper clawsweeper Bot added 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 Oct 6, 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 2a20af4a0d67. GitHub currently reports CLEAN with 35 passing, 1 failing, and 0 pending checks. proof label is sufficient. Durable automated signal: Codex review: blocked before merge..

Author: investigate the 1 failing check(s), establish whether each failure is branch-owned, and publish a green exact-head CI Gate before reconsideration.

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

@bkudiess

Copy link
Copy Markdown
Collaborator

I'd hold this revision until the credential-binding and lifecycle issues below are addressed. Reviewed head: 2a20af4a0d672d61fec4ba95d88d49a7c5bc119e. These are source-level findings, not local reproductions.

  1. Bind credentials and SSH configuration to the same gateway. Dashboard preparation takes SSH settings from global settings while credential resolution uses the active registry record. After switching A to B, both snapshots can agree on B's token paired with A's stale tunnel. The loopback projection can then serve B's token-bearing URL through A. Please capture/revalidate one active gateway record and cover saved-gateway switches with stale settings.

  2. Preserve the connection manager's ownership proofs. Claiming the public port stops the live SSH tunnel. Existing clients retain the old generation and reject the replacement proof, so opening Dashboard can break reconnect. Please coordinate the migration through the manager and test connected operator/node continuity.

  3. Close navigation admission atomically with teardown. TeardownLocked snapshots protected ports before cancelling handoffs, with a state-lock gap between them. Navigation can be admitted in that gap, yet teardown releases its port using the stale snapshot. Please add a barrier-controlled test and make admission/protection capture atomic.

  4. Keep issued-URL protection across backend restarts. The same teardown removes protection markers while retaining the guard. After a same-destination restart without another Dashboard open, a second teardown can release that guard while an earlier browser navigation is still pending. Please preserve the obligation across generations and test submit -> manager stop -> restart -> second stop.

  5. Let normal SSH reconfiguration proceed safely. The production watcher uses consumptionProbe: null, so successful launches keep their leases while SSH runs. Browser-proxy toggles and direct-connect changes can then fail with "held for a dashboard launch." Please separate durable port protection from replacement-blocking leases and test both workflows.

  6. Clean up unused guards when SSH exits during readiness. Once the exit callback clears _process, the lost-ownership early return skips ReleaseUnsubmittedGuard, even when no URL was submitted. Please distinguish natural exit from a superseding attempt and test cleanup without releasing a successor's guard.

  7. Update the new SSH argument assertions for current main. Four assertions in two tests expect -L {port}:..., but main 8915f32b emits -L 127.0.0.1:{port}:.... Preserve that hardening and update the expectations. This is a predicted integration failure, not an observed current-head CI failure.

  8. Isolate the global guard in parallel tests. The retention test holds port 45678 while a different test class expects it to be unguarded. Parallel execution can change the result from localhost to 127.0.0.1. Please allocate isolated ports or serialize the shared state.

For the credential-exposure cases, the token is in the URL fragment, but a page served by the wrong or replacement listener can read it. Releasing or re-pinning a protected port merely on timeout or shell submission is not a safe fix.

The existing same-port gateway-switching policy decision also remains open. Before merge, please run the build, Shared, Tray and Connection suites on the integrated head and provide an isolated connected-tray smoke covering Dashboard open, saved-gateway switching, proxy toggles and repeated manager restart.

@shanselman

Copy link
Copy Markdown
Collaborator

Hi @SebTardif, I'm a Copilot triage agent helping the maintainers work through the ready queue (not Scott himself). Thanks for all the work here; the proof with real ssh.exe is really helpful.

We'd like to land this, and the one thing holding it is the shared local port behavior. Right now, once Open Dashboard has been used, a different saved SSH gateway that uses the same local port can't connect through that port until the app restarts. Many people keep several SSH gateways on the default port, so we'd prefer to keep the new protection without that restriction: keep the old Dashboard endpoint protected, but still let another saved gateway connect without changing its stored settings.

Could you take a look at that when you have time? A small regression test that switches between two saved SSH gateways sharing a port would be great too. No rush, and happy to help if anything is unclear.

@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. merge-risk: 🚨 availability 🚨 Merging this PR could cause crashes, hangs, restart loops, stalls, or process outages. merge-risk: 🚨 security-boundary 🚨 Merging this PR could weaken sandboxing, authorization, credentials, or sensitive data. 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. and removed 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. proof: sufficient Contributor real behavior proof is sufficient. clawsweeper:intake:bug Preliminary submission classification; full source review pending. labels Oct 24, 2026
Opening Dashboard pins the saved forward port to that gateway. A later
saved gateway that stores the same port now listens on a new runtime
port instead of failing the destination check. The saved port stays
pinned to the first gateway, and the stored local port is not rewritten.

Stopping the second gateway leaves the first dashboard port in place.
The new switch test failed on that release before the filter.

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

Copy link
Copy Markdown
Contributor Author

The shared local port case is handled on 6c7b974.

Opening Dashboard still pins that saved port to the first gateway. A second saved SSH gateway that stores the same port now gets a different runtime listener. The stored local port is not changed, and stopping the second gateway does not release the first port.

SelectSharedPortListen_SecondSavedGatewayUsesARuntimePort and Stop_SecondSavedGatewaySharingTheDashboardPort_KeepsTheFirstDestination cover that switch. The stop test failed before the change. ./build.ps1 passed. Shared tests passed 4226 and skipped 33. Tray tests passed 3808.

The runtime port was not opened with ssh.exe or a browser. The earlier ssh.exe and tray dialog proof is still from 2a20af4.

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Nov 7, 2026 •

Copy link
Copy Markdown

🦞👀
Exact review queued.

Re-review progress:

Keep the owned dashboard forward and the runtime port for a second
saved SSH gateway. The setup dashboard launcher from main stays.
SSH argument checks use the loopback bind.

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

Copy link
Copy Markdown
Contributor Author

Merged main so this pull can run product CI. Head 2651ebd.

Open Dashboard still uses the owned forward. A second saved SSH gateway that stores the same local port still gets a runtime listener, and the first dashboard port stays pinned. The setup dashboard path from main is unchanged.

./build.ps1 passed on the resolved tree. On 2651ebd, shared tests passed 4878 and skipped 24. Tray tests passed 5297. The runtime port was not opened with ssh.exe or a browser.

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Nov 7, 2026 •

Copy link
Copy Markdown

🦞👀
Exact review queued.

Re-review progress:

Channels navigation waits for the fixture log from DashboardBrowser.
Opening the URL with the shell directly never wrote that log, so the
UI tests timed out on the chat page.

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

Copy link
Copy Markdown
Contributor Author

The UI job on 2651ebd timed out in Channels navigation because that launch opened the URL directly and never wrote the fixture browser log. 2b003b6 sends the open through DashboardBrowser after the SSH handoff checks. The dashboard contract test passed locally. The full fixture UI run is in CI.

@roboclaw-bot

Copy link
Copy Markdown
Contributor

PR cleanup review

Reviewed head: 2b003b63c57f6cd39cf40fa1dae16162b9d155db. Main comparison: e59374c064f43d68f5c72d070d4c89ef2d20ec3b.

Thanks for the fixture-launch repair. At 2b003b6, both ordinary paths now use DashboardBrowser, and the exact-head UI job passes. This is still needed on main, so I would keep the PR open rather than close it as superseded. The remaining blockers include mixing active-registry credentials with global SSH settings, verifying the relocated proxy port while sending to the saved port, and losing pending-navigation protection during concurrent or repeated teardown. Please bring the repair through one record-bound runtime endpoint and the connection-manager lifecycle, then add current-head two-gateway, proxy and repeated-teardown proof. The current CI Gate is also red; the failing Tray test is SettingsChangeCoordinatorTests.Apply_ConcurrentPermissionChanges_PreserveFinalDisabledOrder, not the repaired fixture launch. This is a source-level triage finding, not landing clearance.

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.

@github-actions

Copy link
Copy Markdown
Contributor

This pull request has been automatically marked as stale due to inactivity.
Please update it or it will be closed.

@github-actions github-actions Bot added the stale label Nov 25, 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: 🚨 availability 🚨 Merging this PR could cause crashes, hangs, restart loops, stalls, or process outages. merge-risk: 🚨 compatibility 🚨 Merging this PR could break existing users, config, migrations, defaults, or upgrades. merge-risk: 🚨 security-boundary 🚨 Merging this PR could weaken sandboxing, authorization, credentials, or sensitive data. P1 Urgent regression or broken agent/channel workflow affecting real users now. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. stale 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.

5 participants