Skip to content

fix(android): strip ws scheme prefix from manual gateway host input#99110

Merged
steipete merged 3 commits into
openclaw:mainfrom
ly85206559:fix/android-manual-gateway-ws-scheme-host
Jul 2, 2026
Merged

fix(android): strip ws scheme prefix from manual gateway host input#99110
steipete merged 3 commits into
openclaw:mainfrom
ly85206559:fix/android-manual-gateway-ws-scheme-host

Conversation

@ly85206559

Copy link
Copy Markdown
Contributor

What Problem This Solves

Fixes #87216. Manual gateway onboarding advertised private LAN ws:// support, but users who typed ws:// (or pasted ws://192.168.x.x) into the Host field got resolved endpoints like http://ws:18789, leading to protocol mismatch before pairing could succeed.

Why This Change Was Made

Add normalizeManualGatewayHostInput to strip accidental ws:// / wss:// / http(s):// prefixes from the manual Host field, reject bare scheme-only input, and reuse the existing endpoint parser on the normalized hostname.

User Impact

Manual LAN setup now resolves HOST=ws://192.168.178.57, PORT=18789, TLS=off to host 192.168.178.57 instead of host ws. Bare ws:// in Host is rejected instead of silently mis-parsing.

Evidence

  • Added regression tests in GatewayConfigResolverTest.kt:
    • normalizeManualGatewayHostInput_rejectsBareWsSchemePrefix
    • composeGatewayManualUrl_acceptsLanHostWithWsSchemePrefix
    • resolveGatewayConnectConfigManual_acceptsLanHostWithWsSchemePrefix
  • Proof command (not run locally; no JDK in this environment):
cd apps/android
./gradlew :app:testPlayDebugUnitTest --tests ai.openclaw.app.ui.GatewayConfigResolverTest

@clawsweeper

clawsweeper Bot commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed July 2, 2026, 2:40 PM ET / 18:40 UTC.

Summary
The PR updates Android manual gateway endpoint composition to preserve pasted ws/wss/http(s) endpoints, reject invalid explicit ports, trim bare-host trailing slashes, and add resolver regression tests.

PR surface: Other +79. Total +79 across 2 files.

Reproducibility: yes. Source inspection shows current main routes manual Host input through composeGatewayManualUrl before parsing, and the inspected before/after Android screenshots demonstrate the reported URL-shaped Host flow moving from rejection to Gateway Recovery.

Review metrics: none identified.

Root-cause cluster
Relationship: fixed_by_candidate
Canonical: #87216
Summary: This PR is the active candidate fix for the linked Android manual ws:// Host parsing bug and now incorporates the already-merged adjacent IPv6 manual-composition work.

Members:

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

Merge readiness
Overall: 🐚 platinum hermit
Proof: 🦞 diamond lobster ✨ media proof bonus
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:

  • Wait for the current-head Android test/build checks to complete.

Risk before merge

  • [P1] Current-head Android test/build checks were still running during this read-only review; merge should wait for those results.
  • [P1] The real app proof covers endpoint acceptance into Gateway Recovery, not a live Gateway service round trip.

Maintainer options:

  1. Decide the mitigation before merge
    Land the endpoint-preservation fix after current-head Android CI finishes, keeping full URL handling in the shared Android resolver and preserving the IPv6 authority helper from current main.
  2. Pause or close
    Do not merge this PR until maintainers decide whether the risk is worth taking.

Next step before merge

  • No automated repair is needed; maintainers should wait for current-head Android CI and then make the ordinary merge decision.

Security
Cleared: The diff only changes Android Kotlin endpoint parsing/composition and unit tests; no concrete security or supply-chain concern was found.

Review details

Best possible solution:

Land the endpoint-preservation fix after current-head Android CI finishes, keeping full URL handling in the shared Android resolver and preserving the IPv6 authority helper from current main.

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

Yes. Source inspection shows current main routes manual Host input through composeGatewayManualUrl before parsing, and the inspected before/after Android screenshots demonstrate the reported URL-shaped Host flow moving from rejection to Gateway Recovery.

Is this the best way to solve the issue?

Yes. Preserving a complete pasted endpoint in the existing manual composer is narrower and safer than stripping schemes, because it keeps the endpoint parser as the single validation path and preserves IPv6 authority formatting from current main.

AGENTS.md: found and applied where relevant.

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

Label changes

Label changes:

  • add proof: sufficient: Contributor real behavior proof is sufficient. Before/after Android screenshots show the changed manual endpoint flow after the fix, supplemented by reported local, Testbox, APK install, and emulator onboarding validation.
  • add proof: 📸 screenshot: Contributor real behavior proof includes screenshot evidence. Before/after Android screenshots show the changed manual endpoint flow after the fix, supplemented by reported local, Testbox, APK install, and emulator onboarding validation.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🦞 diamond lobster and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (screenshot): Before/after Android screenshots show the changed manual endpoint flow after the fix, supplemented by reported local, Testbox, APK install, and emulator onboarding validation.
  • remove rating: 🧂 unranked krab: Current PR rating is rating: 🐚 platinum hermit, so this older rating label is no longer current.
  • remove merge-risk: 🚨 compatibility: Current PR review selected no merge-risk labels.
  • remove status: 📣 needs proof: Current PR status label is status: 👀 ready for maintainer look.

Label justifications:

  • P2: The PR fixes a bounded Android onboarding and gateway pairing bug with real user impact and limited blast radius.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🦞 diamond lobster and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (screenshot): Before/after Android screenshots show the changed manual endpoint flow after the fix, supplemented by reported local, Testbox, APK install, and emulator onboarding validation.
  • proof: sufficient: Contributor real behavior proof is sufficient. Before/after Android screenshots show the changed manual endpoint flow after the fix, supplemented by reported local, Testbox, APK install, and emulator onboarding validation.
  • proof: 📸 screenshot: Contributor real behavior proof includes screenshot evidence. Before/after Android screenshots show the changed manual endpoint flow after the fix, supplemented by reported local, Testbox, APK install, and emulator onboarding validation.
Evidence reviewed

PR surface:

Other +79. Total +79 across 2 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 2 80 1 +79
Total 2 80 1 +79

What I checked:

Likely related people:

  • momothemage: Current-main blame for the parser, manual composer, Connect tab preview path, and gateway WebSocket authority helper points to the Android gateway snapshot carried in commit 3ae5e98bf605. (role: introduced current Android gateway resolver surface; confidence: high; commits: 3ae5e98bf605; files: apps/android/app/src/main/java/ai/openclaw/app/ui/GatewayConfigResolver.kt, apps/android/app/src/main/java/ai/openclaw/app/ui/ConnectTabScreen.kt, apps/android/app/src/main/java/ai/openclaw/app/gateway/GatewaySession.kt)
  • ly85206559: They authored merged PR fix(android): bracket IPv6 hosts in manual gateway URL composition #99107, which changed the same manual composer to reuse the IPv6-safe gateway authority helper on current main. (role: recent current-main adjacent contributor; confidence: high; commits: 97ad0b7c211c; files: apps/android/app/src/main/java/ai/openclaw/app/ui/GatewayConfigResolver.kt, apps/android/app/src/test/java/ai/openclaw/app/ui/GatewayConfigResolverTest.kt)
  • steipete: They merged the adjacent current-main IPv6 manual-composer fix, supplied before/after Android proof for this PR, and authored the maintainer rewrite commits on the branch. (role: recent verifier and branch rewriter; confidence: medium; commits: 0fb908e5adfc, 2f5815518461, 062a9da54188; files: apps/android/app/src/main/java/ai/openclaw/app/ui/GatewayConfigResolver.kt, apps/android/app/src/test/java/ai/openclaw/app/ui/GatewayConfigResolverTest.kt)
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: 🧂 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. P2 Normal backlog priority with limited blast radius. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. labels Jul 2, 2026
@steipete steipete self-assigned this Jul 2, 2026
ly85206559 and others added 2 commits July 2, 2026 19:28
Reject bare ws:// in the Host field and normalize pasted ws:// LAN URLs
so manual onboarding resolves the real hostname instead of host ws.
Fixes openclaw#87216.

Co-authored-by: Cursor <[email protected]>
@steipete
steipete force-pushed the fix/android-manual-gateway-ws-scheme-host branch from 6b46995 to 062a9da Compare July 2, 2026 18:31
@steipete

steipete commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

Maintainer verification

Before — pasting the complete WebSocket endpoint is rejected as an invalid gateway URL.

before

After — the same endpoint is accepted and advances to Gateway Recovery.

after

Maintainer rewrite:

Validation:

  • Local Play GatewayConfigResolverTest: passed after final rebase.
  • Testbox Play + third-party GatewayConfigResolverTest: passed on blacksmith-testbox lease tbx_01kwhyv64b66m8292qmhkft0v6.
  • Play debug APK assemble/install and API 36.1 emulator onboarding replay: passed.
  • Final branch autoreview: no actionable findings after repairing three accepted findings.

Proof gap: no live Gateway service was started; the real app path was verified through exact endpoint acceptance into connection recovery.

Fixes #87216.

@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. 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: 🧂 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. labels Jul 2, 2026
@steipete
steipete merged commit a51b06f into openclaw:main Jul 2, 2026
73 of 82 checks passed
@steipete

steipete commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Jul 3, 2026
…penclaw#99110)

* fix(android): strip ws scheme prefix from manual gateway host input

Reject bare ws:// in the Host field and normalize pasted ws:// LAN URLs
so manual onboarding resolves the real hostname instead of host ws.
Fixes openclaw#87216.

Co-authored-by: Cursor <[email protected]>

* fix(android): preserve complete manual gateway endpoints

* fix(android): preserve gateway i18n inventory

---------

Co-authored-by: Cursor <[email protected]>
Co-authored-by: Peter Steinberger <[email protected]>
@ly85206559
ly85206559 deleted the fix/android-manual-gateway-ws-scheme-host branch July 6, 2026 07:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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

Projects

None yet

2 participants