Repository navigation
fix(portals): reach IPv6 loopback with IPv4-only localhost records - #140580
Conversation
|
🦞👀 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. Reviewed September 6, 2026, 9:38 PM ET / September 7, 2026, 01:38 UTC. ClawSweeper reviewWhat this changesThe PR makes Gateway and worker portals try both loopback address families regardless of localhost DNS records, with regression coverage and updated documentation. Merge readiness✅ Ready for maintainer review This remains a useful, focused repair: current main still depends on system localhost records in both affected paths. No actionable introduced defect was found, and the maintainer-protected PR is not a cleanup candidate. Priority: P2 Review scores
Verification
How this fits togetherPortals proxy browser HTTP and WebSocket traffic to development servers on the Gateway host or a connected worker. The changed connection options determine how those servers are reached over local TCP. flowchart TD
A[Browser request] --> B[Portal authorization]
B --> C{Application location}
C --> D[Gateway connection]
C --> E[Worker stream]
D --> F[Explicit loopback addresses]
E --> F
F --> G[Local development server]
G --> H[Proxied response]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource +24, Tests +58, Docs 0. Total +82 across 8 files. View PR surface stats
Review metricsNone. Technical reviewBest possible solution: Keep loopback address selection shared across Gateway and worker portals while preserving existing authorization, cancellation, and connection cleanup. Do we have a high-confidence way to reproduce the issue? Yes, from source: an IPv6-only application with IPv4-only localhost resolution leaves both current-main callers without the required address. The PR adds this controlled scenario; this read-only review did not execute it. Is this the best way to solve the issue? Yes. Supplying the two loopback literals at the shared dialing boundary repairs the documented contract without a new setting or changes to lifecycle ownership. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against b39b6276cac2. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
|
Merged via squash.
|
…137098 * commit '8a540c252002878f3c3e9d8dfb837b83c8602a78': (2210 commits) perf(plugins): keep bundled catalog lookups lightweight (#140597) refactor: streamline skills JSON serialization (#140581) fix(feishu): expand quoted merged-forward messages (#136231) fix(talk): keep opaque realtime routes out of public config (#129144) fix(ci): avoid Linux packaging on pull requests (#140589) fix(usage): release completed request payloads (#140588) fix(tooling): omit Trae machine squash credit (#140562) fix(ui): stop catalog paging in hidden tabs (#140583) fix(portals): reach IPv6 loopback with IPv4-only localhost records (#140580) fix(transcripts): preserve fixed and legacy capture history (#140563) fix(ui): prevent Talk E2E audio capture stalls (#138803) fix(media): release completed document source buffers (#140561) fix(anthropic): preserve resumed CLI caches across Git changes (#140566) chore(ui): refresh control ui locales (#140586) fix(ui): keep usage exports bound to their session instance (#140573) refactor(exa): test response readers through tool execution (#140572) fix(macos): omit incompatible worker binaries from app bundles (#140557) fix: avoid retaining discarded tool output (#140570) refactor(gateway): share placement move matching (#140569) fix(gateway): preserve child turns during systemd drain (#140568) ... # Conflicts: # .agents/skills/release-openclaw-maintainer/SKILL.md # docs/reference/RELEASING.md
Related: #139428
What Problem This Solves
Fixes an issue where users opening a portal backed by an IPv6-only local server would fail to connect when the host's
localhostrecords listed only IPv4. This affects both Gateway-hosted targets and worker portal streams, despite their documented support for either loopback family.Why This Change Was Made
Gateway and worker connections now share explicit IPv4 and IPv6 loopback lookup options while retaining Node's automatic family selection. The lookup supplies only
127.0.0.1and::1; connection ordering relative to portal attachment, cancellation, and socket cleanup stays with the existing owners. The portal documentation now makes the host-DNS independence explicit.User Impact
Portals can reach IPv4-only or IPv6-only local applications even when system localhost records omit the application's address family. No configuration change is required.
Evidence
Controlled IPv4-only localhost resolution made both existing integration suites fail before the production fix. With the fix, all 83 cases across five focused files passed, including real Gateway and worker socket flows. The final helper test adjustment passed both explicit-family cases. Fresh independent P2 review is scoped-clean with no actionable findings.
The final full changed gate, formatting, diff checks, and deslop passed. An earlier gate caught a Promise executor lint issue; the corrected helper passed both cases and the complete gate. This correctness repair adds 58 test/support lines and 24 production lines, recorded as campaign offsets. No local build, aggregate coverage, or runtime improvement claim is made.