Skip to content

fix: default TLS gateway deep links to port 443 when port is omitted#99887

Closed
ly85206559 wants to merge 9 commits into
openclaw:mainfrom
ly85206559:fix/deeplink-tls-default-port
Closed

fix: default TLS gateway deep links to port 443 when port is omitted#99887
ly85206559 wants to merge 9 commits into
openclaw:mainfrom
ly85206559:fix/deeplink-tls-default-port

Conversation

@ly85206559

@ly85206559 ly85206559 commented Jul 4, 2026

Copy link
Copy Markdown
Contributor

What Problem This Solves

Fixes two coupled iOS gateway setup failures:

  • A gateway deep link with TLS enabled and no explicit port parsed to port 18789 instead of the standard TLS port 443.
  • Any mounted Settings view could consume the pending setup request before the routed, canonical Settings screen appeared.

Setup codes and raw gateway URL parsing in OpenClawKit already default omitted TLS/WSS ports to 443; the openclaw://gateway query parser did not.

Why This Change Was Made

Centralize the TLS default-port rule in DeepLinks.swift (tls ? 443 : 18789) and use it for setup payloads, raw URLs, and gateway deep links.

Make gateway setup request ownership explicit: RootTabs consumes the model's one-shot link, selects the gateway route, and passes one typed request only to the canonical phone or iPad Settings surface. Settings acknowledges the request after staging it, preventing both hidden-view consumption and replay after navigation.

The change preserves explicit ports, so existing links such as openclaw://gateway?...&port=18789&tls=1 still parse to 18789.

User Impact

TLS gateway deep links from QR codes or shared links now stage the expected HTTPS/WSS endpoint without requiring an explicit port=443 parameter. This works on both phone and iPad layouts even when another Settings surface is already mounted. Explicit ports remain unchanged, and omitted plaintext ports still default to 18789.

Evidence

Parser regression proof:

  • swift test --package-path apps/shared/OpenClawKit --filter DeepLinksSecurityTests
  • 21 tests passed, covering omitted TLS and plaintext ports plus explicit TLS ports.

Build proof:

  • Fresh generated iOS project, Debug simulator build: ** BUILD SUCCEEDED **
  • SwiftFormat and SwiftLint build phases passed.
  • Native app localization inventory regenerated and native-app-i18n.ts check passes.

Live end-to-end proof using the exact built app:

  • iPhone 17 simulator: opened and applied two consecutive unique TLS links without ports. Each Connect replaced the previous host and applied port 443 with TLS.
  • iPad Pro 13-inch simulator: repeated the same two-link matrix in canonical sidebar Settings. The second request replaced the first and retained port 443 with TLS.

Review and related-work check:

@clawsweeper

clawsweeper Bot commented Jul 4, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed July 5, 2026, 8:28 AM ET / 12:28 UTC.

Summary
This PR changes OpenClawKit gateway deep-link parsing to default omitted TLS ports to 443, routes iOS gateway setup requests through RootTabs to Settings, updates tests, removes a dead terminal helper, and refreshes native i18n inventory.

PR surface: Other +56. Total +56 across 7 files.

Reproducibility: yes. from source inspection: current main hard-codes omitted openclaw://gateway ports to 18789 before considering tls, while setup-code and raw WSS/HTTPS inputs already default omitted TLS ports to 443. I did not run the simulator in this read-only review.

Review metrics: 1 noteworthy metric.

  • Gateway deep-link defaults: 1 changed default. The PR changes the omitted-port default for tls=1 gateway deep links, which is compatibility-relevant before merge.

Merge readiness
Overall: 🐚 platinum hermit
Proof: 🐚 platinum hermit
Patch quality: 🐚 platinum hermit
Result: ready for maintainer review.

Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch.

Rank-up moves:

  • [P2] Let exact-head CI finish green or repair any diff-caused failing lane before merge.

Risk before merge

  • [P1] Merging changes existing omitted-port tls=1 iOS gateway deep links from port 18789 to 443 unless those links include an explicit port.
  • [P1] Exact-head CI was still in progress during inspection, so normal merge readiness still depends on the required checks finishing green.

Maintainer options:

  1. Accept corrected TLS default (recommended)
    Merge after CI if maintainers are comfortable that omitted tls=1 links now resolve to 443 and non-443 TLS deployments must specify port.
  2. Add compatibility wording
    Require PR-body or release-note context that calls out explicit port for non-443 TLS gateway links before merge.
  3. Pause if legacy behavior is required
    Keep the PR paused if omitted-port TLS links must continue targeting 18789 by default.

Next step before merge

  • [P2] Maintainers should decide the omitted TLS port compatibility change and wait for exact-head CI; there is no narrow automated repair to queue.

Maintainer decision needed

  • Question: Should omitted tls=1 iOS gateway deep links intentionally switch from the old 18789 fallback to the standard TLS port 443 while preserving explicit port values?
  • Rationale: The code path is a valid bug fix against existing setup-code and raw WSS defaults, but it changes behavior for any existing non-443 TLS deployment that omitted port.
  • Likely owner: steipete — steipete is assigned and has both recent branch and current-main ownership signals for the affected iOS setup path.
  • Options:
    • Accept the corrected TLS default (recommended): Merge after CI with the expectation that non-443 TLS gateway links must include an explicit port.
    • Require compatibility wording first: Ask for PR-body or release-note wording that tells users with non-443 TLS gateways to include port in deep links before merge.
    • Keep the legacy fallback: Reject this default change and require another product path for omitted-port TLS deep links.

Security
Cleared: The diff changes iOS deep-link parsing and in-memory setup-request delivery without adding dependencies, workflows, secret storage, downloaded code, or a broader plaintext transport allowance.

Review details

Best possible solution:

Land this focused fix or an equivalent one after maintainers accept the omitted-TLS-port compatibility change and exact-head CI is green.

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

Yes, from source inspection: current main hard-codes omitted openclaw://gateway ports to 18789 before considering tls, while setup-code and raw WSS/HTTPS inputs already default omitted TLS ports to 443. I did not run the simulator in this read-only review.

Is this the best way to solve the issue?

Yes, this is the best fix shape: centralizing the TLS default in OpenClawKit removes parser drift, and RootTabs is the right owner for one-shot setup delivery to the canonical Settings surface. The only safer addition would be maintainer-approved compatibility wording for non-443 TLS links.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against fd2e4da00651.

Label changes

Label justifications:

  • P2: This is a normal-priority iOS setup correctness fix with limited blast radius around gateway pairing and deep links.
  • merge-risk: 🚨 compatibility: Merging changes existing omitted-port tls=1 gateway deep links from 18789 to 443 unless the link includes an explicit port.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (live_output): The PR body reports exact-head parser tests, a Debug simulator build, native i18n verification, and live iPhone/iPad simulator runs showing TLS links without ports applying port 443.
  • proof: sufficient: Contributor real behavior proof is sufficient. The PR body reports exact-head parser tests, a Debug simulator build, native i18n verification, and live iPhone/iPad simulator runs showing TLS links without ports applying port 443.
Evidence reviewed

PR surface:

Other +56. Total +56 across 7 files.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 0 0 0 0
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 7 131 75 +56
Total 7 131 75 +56

What I checked:

Likely related people:

  • steipete: steipete is assigned, authored the latest branch commits, and recent current-main history touches both iOS RootTabs and shared DeepLinks behavior. (role: recent area contributor and likely follow-up owner; confidence: high; commits: a56254d1d183, c64a306f908b, 211e0d7263c1; files: apps/ios/Sources/RootTabs.swift, apps/ios/Sources/Design/SettingsProTab.swift, apps/shared/OpenClawKit/Sources/OpenClawKit/DeepLinks.swift)
  • mbelinky: GitHub commit metadata links mbelinky to the original iOS QR pairing flow and insecure gateway deep-link hardening history that established this parser surface. (role: earlier iOS pairing and deep-link contributor; confidence: medium; commits: 130e59a9c096, ebae6f918e18; files: apps/shared/OpenClawKit/Sources/OpenClawKit/DeepLinks.swift, apps/shared/OpenClawKit/Tests/OpenClawKitTests/DeepLinksSecurityTests.swift)
  • BunsDev: Recent path history shows BunsDev working on iOS LAN pairing and gateway setup hardening in the same OpenClawKit deep-link area. (role: gateway pairing hardening contributor; confidence: medium; commits: 36df0d93b93a, b2efd1964800; files: apps/shared/OpenClawKit/Sources/OpenClawKit/DeepLinks.swift, apps/shared/OpenClawKit/Tests/OpenClawKitTests/DeepLinksSecurityTests.swift)
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.
Review history (7 earlier review cycles)
  • reviewed 2026-07-04T08:23:28.415Z sha 9e73a8a :: needs real behavior proof before merge. :: none
  • reviewed 2026-07-04T08:29:33.384Z sha 9e73a8a :: needs real behavior proof before merge. :: none
  • reviewed 2026-07-04T08:46:52.829Z sha 9e73a8a :: needs real behavior proof before merge. :: none
  • reviewed 2026-07-04T08:55:08.829Z sha 9e73a8a :: needs real behavior proof before merge. :: none
  • reviewed 2026-07-05T09:42:40.598Z sha 41c653a :: needs real behavior proof before merge. :: none
  • reviewed 2026-07-05T11:43:30.630Z sha 4e7921b :: needs maintainer review before merge. :: none
  • reviewed 2026-07-05T12:20:30.000Z sha ad20758 :: needs maintainer review before merge. :: none

@ly85206559 ly85206559 changed the title OpenClawKit: default TLS gateway deep links to port 443 fix: TLS gateway deep links use port 18789 when port is omitted Jul 4, 2026
@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. P2 Normal backlog priority with limited blast radius. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. labels Jul 4, 2026
@steipete steipete self-assigned this Jul 4, 2026
@ly85206559 ly85206559 changed the title fix: TLS gateway deep links use port 18789 when port is omitted fix: default TLS gateway deep links to port 443 when port is omitted Jul 4, 2026
@ly85206559
ly85206559 force-pushed the fix/deeplink-tls-default-port branch from 9e73a8a to 41c653a Compare July 5, 2026 09:24
@openclaw-barnacle openclaw-barnacle Bot added triage: needs-pr-context Candidate: external PR body lacks required problem context or evidence. and removed triage: needs-pr-context Candidate: external PR body lacks required problem context or evidence. labels Jul 5, 2026
@steipete
steipete force-pushed the fix/deeplink-tls-default-port branch from 41c653a to ea70d70 Compare July 5, 2026 11:07
@openclaw-barnacle openclaw-barnacle Bot added app: ios App: ios size: S and removed size: XS labels Jul 5, 2026
@steipete
steipete force-pushed the fix/deeplink-tls-default-port branch from 71bc183 to 4e7921b Compare July 5, 2026 11:35
@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. 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 rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Jul 5, 2026
@steipete
steipete force-pushed the fix/deeplink-tls-default-port branch 2 times, most recently from 49b58d2 to 42367f0 Compare July 5, 2026 11:57
@steipete
steipete force-pushed the fix/deeplink-tls-default-port branch from 65aa991 to ad20758 Compare July 5, 2026 12:13
@clawsweeper clawsweeper Bot removed the proof: sufficient ClawSweeper judged the real behavior proof convincing. label Jul 5, 2026
@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. 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. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. 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. labels Jul 5, 2026
@steipete
steipete force-pushed the fix/deeplink-tls-default-port branch from ad20758 to a56254d Compare July 5, 2026 12:22
@steipete

steipete commented Jul 5, 2026

Copy link
Copy Markdown
Contributor

Thank you for the contribution. This fix landed with contributor co-authorship preserved in #100258 (deac98eb7204fdb51589c5e369b95be128215e77).

I consolidated the source fixes into a maintainer takeover because the contributor branches were based on rewritten pre-main history; updating them directly would have pulled unrelated changes into the review surface. Closing this PR as superseded by the landed batch.

@steipete steipete closed this Jul 5, 2026
@steipete

steipete commented Jul 5, 2026

Copy link
Copy Markdown
Contributor

Land-ready validation for a56254d1d1836d37ef96c7af8acd5f5a131538e0:

No screenshot was attached because this changes parsing and one-shot state ownership, not layout or styling; the meaningful before/after proof is the applied host/port/TLS state above.

@ly85206559
ly85206559 deleted the fix/deeplink-tls-default-port branch July 5, 2026 12:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

app: ios App: ios merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: M status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants