Add SSH server port for managed tunnels
Summary
- Adds a separate SSH daemon port (
sshPort, default22) for managed SSH tunnels instead of overloading the forwarded gateway remote port. - Persists the port in gateway records and legacy settings, migrates older settings/records safely, and treats port changes as operator reconnects.
- Exposes the SSH port in the Add Gateway and diagnostics direct-connect UIs, including localized labels and validation.
Fixes #697
Validation
dotnet test .\tests\OpenClaw.Shared.Tests\OpenClaw.Shared.Tests.csproj --no-restore --filter "FullyQualifiedName~SshTunnelCommandLineTests"dotnet test .\tests\OpenClaw.Connection.Tests\OpenClaw.Connection.Tests.csproj --no-restoredotnet test .\tests\OpenClaw.Tray.Tests\OpenClaw.Tray.Tests.csproj --no-restore.\build.ps1git diff --check
Manual proof
- Configured local OpenSSH Server to listen only on
127.0.0.1:2222. - Verified
ssh -p 2222 -l OpenClawSshRepro 127.0.0.1 hostnamesucceeds while port22fails. - On
master, the Add Gateway SSH UI has no SSH port field, so it cannot express2222. - On this branch, the fixed UI accepts
SSH port = 2222; tray logs show the tunnel starts via[email protected]:2222.
Review
- Ran Hanselman-style dual-model review (Opus + Codex).
- Fixed agreed/actionable findings around diagnostics port validation, diagnostics settings persistence, and invalid settings normalization.
- Remaining low-severity notes were accepted as non-blocking: snapshot does not expose active SSH port and upgrade may trigger a one-time tunnel restart due to the new spec identity.
Codex review: needs real behavior proof before merge. Reviewed June 5, 2026, 5:14 PM ET / 21:14 UTC.
Summary Review failed before ClawSweeper could summarize the requested change.
Reproducibility: unclear. The review failed before ClawSweeper could establish a reproduction path.
Review metrics: none identified.
Merge readiness Overall: ๐ off-meta tidepool Proof: ๐ off-meta tidepool Patch quality: ๐ off-meta tidepool Result: rating does not apply to this item.
Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch.
Risk before merge
- [P1] No close action taken because the review did not complete.
Maintainer options:
- Decide the mitigation before merge
Retry the Codex review after fixing the execution failure. - Pause or close
Do not merge this PR until maintainers decide whether the risk is worth taking.
Next step before merge
- [P1] Review did not complete, so no work-lane recommendation was made.
Review details
Best possible solution:
Retry the Codex review after fixing the execution failure.
Do we have a high-confidence way to reproduce the issue?
Unclear. The review failed before ClawSweeper could establish a reproduction path.
Is this the best way to solve the issue?
Unclear. Retry the review first so ClawSweeper can evaluate the actual issue and fix direction.
AGENTS.md: unclear because the file could not be read completely.
Codex review notes: model gpt-5.5, reasoning high; reviewed against 077d44cc6cd2.
Label changes
Label changes:
- add
rating: ๐ off-meta tidepool: Overall readiness is ๐ off-meta tidepool; proof is ๐ off-meta tidepool and patch quality is ๐ off-meta tidepool. - remove
status: ๐ฃ needs proof: Current PR status no longer selects a status label. - remove
rating: ๐ฆช silver shellfish: Current PR rating israting: ๐ off-meta tidepool, so this older rating label is no longer current.
Label justifications:
rating: ๐ off-meta tidepool: Overall readiness is ๐ off-meta tidepool; proof is ๐ off-meta tidepool and patch quality is ๐ off-meta tidepool.
Evidence reviewed
What I checked:
- failure reason: timeout.
- codex failure detail: Codex review failed for this PR: spawnSync codex ETIMEDOUT.
- codex stdout: Per-item Codex failure; continuing with the rest of the shard.
Likely related people:
- unknown: Codex failed before it could trace repository history. (role: review did not complete; confidence: low)
What the crustacean ranks mean
- ๐ฆ challenger crab: rare, exceptional readiness with strong proof, clean implementation, and convincing validation.
- ๐ฆ diamond lobster: very strong readiness with only minor maintainer review expected.
- ๐ platinum hermit: good normal PR, likely mergeable with ordinary maintainer review.
- ๐ฆ gold shrimp: useful signal, but proof or patch confidence is still limited.
- ๐ฆช silver shellfish: thin signal; proof, validation, or implementation needs work.
- ๐ง unranked krab: not merge-ready because proof is missing/unusable or there are serious correctness or safety concerns.
- ๐ off-meta tidepool: rating does not apply to this item.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.
How this review workflow works
- ClawSweeper keeps one durable marker-backed review comment per issue or PR.
- Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
- A fresh review can be triggered by eligible
@clawsweeper re-reviewcomments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch. - PR/issue authors and users with repository write access can comment
@clawsweeper re-reviewor@clawsweeper re-runon an open PR or issue to request a fresh review only. - Maintainers can also comment
@clawsweeper reviewto request a fresh review only. - Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
- Maintainer-only repair and merge flows require explicit commands such as
@clawsweeper autofix,@clawsweeper automerge,@clawsweeper fix ci, or@clawsweeper address review. - Maintainers can comment
@clawsweeper explainto ask for more context, or@clawsweeper stopto stop active automation.
real-behavior proof: logs after the fix, showing the SSH tunnel has connected successfully
@clawsweeper re-review
๐ฆ๐งน ClawSweeper re-review requested.
I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: the existing ClawSweeper review comment will be edited in place when the review finishes.
Re-review progress:
- State: Failed
- Detail: The targeted re-review did not finish cleanly. Check the workflow run for details.
- Run: https://github.com/openclaw/clawsweeper/actions/runs/27037129891
- Updated: 2026-06-05T20:01:13.091Z
Merged after first-pass triage.
Follow-up found during adversarial review: BuildBrowserProxySshForwardHint should include -p <sshPort> when the managed tunnel uses a non-default SSH daemon port, otherwise the diagnostic copy/paste hint can point users back at port 22. Core tunnel command construction, migration, validation, persistence, and reconnect behavior looked safe.