Repository navigation
fix(ios): refused Gateway connections name the address and stop suggesting Tailscale setup - #198945
Conversation
… users to setup A Gateway behind Tailscale Serve listens on loopback only; dialing its tailnet address on the Gateway port is refused. The reconnect error named no address, and manual entry reported "not reachable" because the TCP check could not tell a refusal from a dead network. Both now name the address and point to the Serve name or a new setup code.
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: needs maintainer review before merge. What this changesThis PR distinguishes refused connections from unreachable hosts and adds the dialed address and appropriate recovery guidance to iOS Gateway errors. Example: Manually connect to 100.77.74.91 on port 18809 when the Gateway is available through Tailscale Serve instead.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review Keep this PR open: it fixes misleading iOS connection recovery guidance that remains on main, and I found no actionable patch defect. Priority: P2 Before mergeNone. FindingsNone. Provenance
Agent review detailsHow this fits togetherThe iOS connection controller probes candidate endpoints before TLS verification, while NodeAppModel maps reconnect errors; both feed typed problems into the existing connection banners and details sheet. flowchart TD
A[Manual Gateway entry] --> B[TCP and TLS probes]
B --> D[Gateway connection problem]
C[Saved Gateway reconnect] --> E[Transport error mapper]
E --> D
D --> F[Endpoint guidance]
F --> G[Connection banner and details]
Technical reviewBest possible solution: Keep refusal classification in the existing probes and share endpoint-specific recovery text across preflight and reconnect paths, as this PR does. Do we have a high-confidence way to reproduce the issue? The current-main probe and guidance paths explain the reported behavior, and the contributor supplies matching simulator before/after screenshots plus an affected App Store 2026.11.3 report; I did not execute a reproduction. Is this the best way to solve the issue? The change repairs the existing owners with a three-state probe result and shared refusal presentation, preserving route eligibility, TLS verification, and retry semantics without unnecessary machinery. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against db1708fc9088. Provenance checked
TestingProof path: shipped entry point. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource +94, Tests +83, Docs +6. Total +183 across 14 files. Added test files: 0. View PR surface stats
Preflight sourceSource unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified. LabelsLabel changes:
Label justifications:
Rating scale6/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. WorkflowClawSweeper edits this one comment on every review. Comment Reviewed November 14, 2026, 10:25 AM ET / 15:25 UTC. |
|
Maintainer note: the one red job, |
|
Landed as 72f7f8e. A refused Gateway connection on iOS now names the address it dialed, on both reconnect and manual entry, and on a Tailscale address says Tailscale works and points to the Serve name or |
…sting Tailscale setup (openclaw#198945) ## What Problem This Solves Fixes: when the iPhone app dials a Gateway on a port where nothing listens (for example a Gateway behind Tailscale Serve, dialed on its own loopback port), it says the host refused or could not be reached, without the address on reconnect, and tells a user whose Tailscale works to install or open Tailscale. ## User Impact User impact: a refused connection says "<host>:<port> refused the connection: nothing accepts connections on that port", both when reconnecting a saved Gateway and when entering an address by hand. On a Tailscale address it says Tailscale is working and to connect to the Gateway's `.ts.net` name without a port, links the Tailscale Serve docs, and offers `openclaw qr` to copy. Timeouts and unreachable errors on reconnect now name the address too. ## Why This Change Was Made - **Reconnect path.** The mapped transport problem had no route context. The endpoint guidance step now receives the dialed port and names the address. - **Manual-entry path.** The pre-connect TCP check returned only reachable or not, and `Network` reports a refusal as `.waiting(ECONNREFUSED)`, which the check ignored until its 3-second timeout. It now returns `reachable`, `refused` or `unreachable`; a refusal ends the check at once and becomes a refused problem instead of "not reachable". The TLS probe maps `cannotConnectToHost` the same way. - One helper owns the refused message, docs link and command, so both paths say the same thing. - Setup-code route selection still picks only routes that connect. - The iOS docs state that a `.ts.net` name without a port uses 443 and what the refused error means. Not changed: discovered Gateways still need advertised TLS or a saved pin before the app dials them, which already keeps a loopback-only Gateway's LAN advert from being dialed. ## Evidence - Real setup: a Gateway behind Tailscale Serve; its tailnet address on port 18809 returns `Connection refused` while Serve's port 443 connects. The iPhone (App Store 2026.11.3) showed the generic refused message and connected after scanning `openclaw qr`. - iOS simulator, manual entry of `100.77.74.91` port `18809`, before → after:   - New tests, red on `main` and green here: the reconnect path (`mapNodeGatewayConnectionError` with a `wss://100.77.74.91:18809` route: 4 failed checks on `main`) and the manual-entry path (a refused TCP probe yields a refused problem naming the address, with no TLS probe). - `GatewayConnectionIssueTests`, `GatewayConnectionSecurityTests`, `GatewayConnectionControllerTests`, `GatewayIngressControllerTests`: all pass. `SwiftUIRenderSmokeTests` "managed assistant media … playback route" (audio transcode) times out the same way on `main`. No overlap with Pash/Sarah changes. **Merge danger:** two-way door; no state, config or protocol change. Blast radius: iOS connection problem text and help links for refused, timed-out and unreachable Gateways, and how fast the pre-connect check gives up on a refused port (immediately instead of after 3 s). Co-authored-by: Ayaan Zaidi <[email protected]>
What Problem This Solves
Fixes: when the iPhone app dials a Gateway on a port where nothing listens (for example a Gateway behind Tailscale Serve, dialed on its own loopback port), it says the host refused or could not be reached, without the address on reconnect, and tells a user whose Tailscale works to install or open Tailscale.
User Impact
User impact: a refused connection says ": refused the connection: nothing accepts connections on that port", both when reconnecting a saved Gateway and when entering an address by hand. On a Tailscale address it says Tailscale is working and to connect to the Gateway's
.ts.netname without a port, links the Tailscale Serve docs, and offersopenclaw qrto copy. Timeouts and unreachable errors on reconnect now name the address too.Why This Change Was Made
Networkreports a refusal as.waiting(ECONNREFUSED), which the check ignored until its 3-second timeout. It now returnsreachable,refusedorunreachable; a refusal ends the check at once and becomes a refused problem instead of "not reachable". The TLS probe mapscannotConnectToHostthe same way..ts.netname without a port uses 443 and what the refused error means.Not changed: discovered Gateways still need advertised TLS or a saved pin before the app dials them, which already keeps a loopback-only Gateway's LAN advert from being dialed.
Evidence
Real setup: a Gateway behind Tailscale Serve; its tailnet address on port 18809 returns
Connection refusedwhile Serve's port 443 connects. The iPhone (App Store 2026.11.3) showed the generic refused message and connected after scanningopenclaw qr.iOS simulator, manual entry of
100.77.74.91port18809, before → after:New tests, red on
mainand green here: the reconnect path (mapNodeGatewayConnectionErrorwith awss://100.77.74.91:18809route: 4 failed checks onmain) and the manual-entry path (a refused TCP probe yields a refused problem naming the address, with no TLS probe).GatewayConnectionIssueTests,GatewayConnectionSecurityTests,GatewayConnectionControllerTests,GatewayIngressControllerTests: all pass.SwiftUIRenderSmokeTests"managed assistant media … playback route" (audio transcode) times out the same way onmain.No overlap with Pash/Sarah changes.
Merge danger: two-way door; no state, config or protocol change. Blast radius: iOS connection problem text and help links for refused, timed-out and unreachable Gateways, and how fast the pre-connect check gives up on a refused port (immediately instead of after 3 s).