Skip to content

Add SSH server port for managed tunnels#701

Merged
shanselman merged 2 commits into
openclaw:masterfrom
christineyan4:fix-697-ssh-server-port
Jun 7, 2026
Merged

Add SSH server port for managed tunnels#701
shanselman merged 2 commits into
openclaw:masterfrom
christineyan4:fix-697-ssh-server-port

Conversation

@christineyan4

Copy link
Copy Markdown
Contributor

Summary

  • Adds a separate SSH daemon port (sshPort, default 22) 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-restore
  • dotnet test .\tests\OpenClaw.Tray.Tests\OpenClaw.Tray.Tests.csproj --no-restore
  • .\build.ps1
  • git 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 hostname succeeds while port 22 fails.
  • On master, the Add Gateway SSH UI has no SSH port field, so it cannot express 2222.
  • On this branch, the fixed UI accepts SSH port = 2222; tray logs show the tunnel starts via OpenClawSshRepro@127.0.0.1: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.

Allow managed SSH tunnel configurations to specify the SSH daemon port separately from the remote gateway port. Persist the setting across gateway records and legacy settings, expose it in connection UIs, and include it in tunnel restart identity and command generation.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@clawsweeper

clawsweeper Bot commented Jun 5, 2026

Copy link
Copy Markdown

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:

  1. Decide the mitigation before merge
    Retry the Codex review after fixing the execution failure.
  2. 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 is rating: 🌊 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-review comments, 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-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to 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 explain to ask for more context, or @clawsweeper stop to stop active automation.

@clawsweeper clawsweeper Bot added 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 Jun 5, 2026
@christineyan4

Copy link
Copy Markdown
Contributor Author
Screenshot 2026-06-05 124522 real-behavior proof: logs after the fix, showing the SSH tunnel has connected successfully

@christineyan4

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Jun 5, 2026

Copy link
Copy Markdown

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: the existing ClawSweeper review comment will be edited in place when the review finishes.

Re-review progress:

@clawsweeper clawsweeper Bot added rating: 🌊 off-meta tidepool PR readiness rating does not apply to this item. and removed 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 Jun 5, 2026
@shanselman

Copy link
Copy Markdown
Contributor

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.

@shanselman shanselman merged commit e0a4b7c into openclaw:master Jun 7, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

rating: 🌊 off-meta tidepool PR readiness rating does not apply to this item.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

SSH tunnel setup does not support custom SSH server ports

2 participants