Skip to content

fix(android): bracket IPv6 hosts in manual gateway URL composition#99107

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

fix(android): bracket IPv6 hosts in manual gateway URL composition#99107
steipete merged 3 commits into
openclaw:mainfrom
ly85206559:fix/android-ipv6-manual-gateway-url

Conversation

@ly85206559

Copy link
Copy Markdown
Contributor

What Problem This Solves

Manual gateway onboarding accepts IPv6 hosts such as ::1, but composeGatewayManualUrl built URLs like http://::1:18789, which Java URI cannot parse. Users entering IPv6 loopback or LAN addresses in the Host field could not connect even though pasted ws://[::1] URLs worked.

Why This Change Was Made

Reuse the existing formatGatewayAuthority helper (already used for WebSocket URLs) when composing manual gateway URLs so IPv6 hosts are bracketed consistently.

User Impact

Android manual/advanced gateway setup now resolves IPv6 hosts correctly (for example ::1 on port 18789).

Evidence

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

@clawsweeper

clawsweeper Bot commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

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

Summary
The PR changes Android manual gateway URL composition to format host and port through the existing gateway authority helper so bare IPv6 literals are bracketed before parsing.

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

Reproducibility: yes. Source inspection shows current main composes bare manual IPv6 input into an unbracketed URL before java.net.URI parsing, and the PR discussion includes before/after Android screenshots for that path.

Review metrics: none identified.

Root-cause cluster
Relationship: canonical
Canonical: #99107
Summary: This PR is the active canonical candidate for Android manual IPv6 host bracketing; adjacent open work covers a different manual Host input normalization issue.

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:

  • [P2] Wait for the current-head android-build-play check to complete before merge.

Risk before merge

  • [P1] Live status for head 2f58155 still had android-build-play in progress during this review, so maintainers should wait for that current-head check before merge.

Maintainer options:

  1. Decide the mitigation before merge
    Land the narrow formatter reuse once current-head Android CI finishes, while keeping scheme-prefixed Host input normalization in the adjacent PR rather than widening this branch.
  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 CI completion and then make the ordinary merge decision.

Security
Cleared: No concrete security or supply-chain concern was found; the diff only changes Android Kotlin URL composition and a focused unit test.

Review details

Best possible solution:

Land the narrow formatter reuse once current-head Android CI finishes, while keeping scheme-prefixed Host input normalization in the adjacent PR rather than widening this branch.

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

Yes. Source inspection shows current main composes bare manual IPv6 input into an unbracketed URL before java.net.URI parsing, and the PR discussion includes before/after Android screenshots for that path.

Is this the best way to solve the issue?

Yes. Reusing the existing formatGatewayAuthority helper is the narrowest maintainable fix because the WebSocket URL path already uses it to bracket IPv6 hosts, avoiding a second formatting rule.

AGENTS.md: found and applied where relevant.

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

Label changes

Label justifications:

  • P2: This fixes a bounded Android manual gateway connectivity bug for IPv6 host literals with 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): Maintainer-supplied before/after Android screenshots show bare IPv6 manual host input moving from invalid URL rejection to Gateway Recovery, with the stated gap that no live IPv6 Gateway was available.
  • proof: sufficient: Contributor real behavior proof is sufficient. Maintainer-supplied before/after Android screenshots show bare IPv6 manual host input moving from invalid URL rejection to Gateway Recovery, with the stated gap that no live IPv6 Gateway was available.
  • proof: 📸 screenshot: Contributor real behavior proof includes screenshot evidence. Maintainer-supplied before/after Android screenshots show bare IPv6 manual host input moving from invalid URL rejection to Gateway Recovery, with the stated gap that no live IPv6 Gateway was available.
Evidence reviewed

PR surface:

Other +18. Total +18 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 19 1 +18
Total 2 19 1 +18

What I checked:

Likely related people:

  • Lokimorty: Blame for the manual URL composer, endpoint parser, and IPv6 authority helper points to commit 4f933cc in current main history. (role: introduced current Android gateway snapshot; confidence: high; commits: 4f933ccf7b62; files: apps/android/app/src/main/java/ai/openclaw/app/ui/GatewayConfigResolver.kt, apps/android/app/src/main/java/ai/openclaw/app/gateway/GatewaySession.kt, apps/android/app/src/test/java/ai/openclaw/app/ui/GatewayConfigResolverTest.kt)
  • steipete: GitHub metadata shows steipete merged the snapshot commit carrying this Android gateway surface, supplied the before/after proof, and authored the branch test/import-cleanup commits. (role: recent merger and branch verifier; confidence: medium; commits: 4f933ccf7b62, 0fb908e5adfc, 2f5815518461; 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)
  • NianJiuZst: Recent merged history on GatewaySession.kt touched Android gateway connection lifecycle behavior near the shared URL-authority helper surface. (role: recent adjacent Android gateway contributor; confidence: medium; commits: 0ccdef5dcf76; files: apps/android/app/src/main/java/ai/openclaw/app/gateway/GatewaySession.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: 🦪 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. labels Jul 2, 2026
@steipete steipete self-assigned this Jul 2, 2026
@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation channel: telegram Channel integration: telegram scripts Repository scripts commands Command implementations agents Agent runtime and tooling extensions: google size: XL and removed size: XS labels Jul 2, 2026
@steipete

steipete commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

Maintainer verification

Before — bare IPv6 manual host is rejected as an invalid gateway URL:

before

After — the same host is accepted and the app advances to Gateway Recovery:

after

Validation:

  • Local Play GatewayConfigResolverTest: passed.
  • Testbox Play + third-party GatewayConfigResolverTest: passed on blacksmith-testbox lease tbx_01kwhyv64b66m8292qmhkft0v6 (run).
  • Play debug APK assemble/install and emulator onboarding replay: passed.
  • Fresh branch autoreview: no actionable findings.

Proof gap: no live IPv6 Gateway was available; the real app path was verified through accepted parsing into connection recovery.

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

🦞🧹
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.

ly85206559 and others added 2 commits July 2, 2026 19:03
Reuse formatGatewayAuthority when building manual gateway URLs so IPv6
loopback and LAN hosts parse correctly during onboarding connect setup.

Co-authored-by: Cursor <[email protected]>
@steipete
steipete force-pushed the fix/android-ipv6-manual-gateway-url branch from 2eb66ac to 0fb908e Compare July 2, 2026 18:03
@openclaw-barnacle openclaw-barnacle Bot added size: XS and removed docs Improvements or additions to documentation channel: telegram Channel integration: telegram scripts Repository scripts commands Command implementations agents Agent runtime and tooling extensions: google size: XL labels Jul 2, 2026
@clawsweeper clawsweeper Bot added the proof: sufficient ClawSweeper judged the real behavior proof convincing. label Jul 2, 2026
@clawsweeper clawsweeper Bot added 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: 🦪 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 Jul 2, 2026
@steipete
steipete merged commit 97ad0b7 into openclaw:main Jul 2, 2026
41 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#99107)

* fix(android): bracket IPv6 hosts in manual gateway URL composition

Reuse formatGatewayAuthority when building manual gateway URLs so IPv6
loopback and LAN hosts parse correctly during onboarding connect setup.

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

* test(android): cover bracketed IPv6 gateway hosts

* fix(android): avoid gateway i18n inventory churn

---------

Co-authored-by: Cursor <[email protected]>
Co-authored-by: Peter Steinberger <[email protected]>
@ly85206559
ly85206559 deleted the fix/android-ipv6-manual-gateway-url 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 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: XS 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