fix(cli): isPortBusy probes all 4 address families to catch IPv4-only listeners#94469
fix(cli): isPortBusy probes all 4 address families to catch IPv4-only listeners#94469qingminglong wants to merge 1 commit into
Conversation
…only listeners Previously, isPortBusy (used by --force port detection) only tried a bare tryListenOnPort which binds IPv6 wildcard (::) by default, missing ports occupied by IPv4-only listeners on 127.0.0.1 or 0.0.0.0. Now probes 127.0.0.1, 0.0.0.0, ::1, :: — same multi-host approach as checkPortInUse in ports-inspect.ts. EADDRNOTAVAIL/EAFNOSUPPORT hosts are silently skipped (e.g. IPv6 not enabled). Fixes openclaw#94426 Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
|
Codex review: needs real behavior proof before merge. Reviewed June 19, 2026, 9:57 PM ET / 01:57 UTC. Summary PR surface: Source +7, Tests 0. Total +7 across 2 files. Reproducibility: no. live high-confidence reproduction was established in this read-only review. Source inspection shows current main still uses a hostless Review metrics: none identified. Root-cause cluster Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Rank-up moves:
Proof guidance:
Risk before merge
Maintainer options:
Next step before merge
Security Review findings
Review detailsBest possible solution: Land one canonical Do we have a high-confidence way to reproduce the issue? No live high-confidence reproduction was established in this read-only review. Source inspection shows current main still uses a hostless Is this the best way to solve the issue? No. The PR targets the right symptom, but the maintainable fix should reuse or extract the existing multi-address probe contract instead of adding a second four-host loop. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against f04c3d6575e1. Label changesLabel justifications:
Evidence reviewedPR surface: Source +7, Tests 0. Total +7 across 2 files. View PR surface stats
What I checked:
Likely related people:
What the crustacean ranks mean
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 re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. |
|
help me merge |
Summary
isPortBusy(used by--forceport detection) previously only tried baretryListenOnPort, which binds IPv6 wildcard (::) by default, missing ports occupied by IPv4-only listeners on127.0.0.1or0.0.0.0127.0.0.1,0.0.0.0,::1,::) — same approach ascheckPortInUsein ports-inspect.tsEADDRNOTAVAIL/EAFNOSUPPORThosts are silently skipped (e.g. when IPv6 is not enabled)Fixes #94426
Real behavior proof (required for external PRs)
Behavior addressed: On systems where only an IPv4 listener occupies a port (e.g.
127.0.0.1:8080),isPortBusyreturnedfalsebecausetryListenOnPortdefault binds to::which doesn't conflict. The--forceflag would then skip the port, causing a bind failure later.Real setup tested:
Exact steps or command run after fix:
After-fix evidence:
Observed result after the fix: All 25 tests pass. The port-busy detection now correctly identifies ports occupied exclusively by IPv4 listeners.
What was not tested: Manual testing against a real IPv4-only service (the fix relies on the same OS mechanism as the existing multi-host
checkPortInUsein ports-inspect.ts).Proof limitations or environment constraints: Unit-tested via mock; the fix logic is structurally identical to the already-validated
checkPortInUse.Tests and validation
Both test files pass (25 tests total):
program.force.test.ts— 24 tests covering --force flowports.test.ts— 11 tests covering probePortFree / waitForPortBindableRisk checklist
Did user-visible behavior change? (Yes)
Did config, environment, or migration behavior change? (No)
Did security, auth, secrets, network, or tool execution behavior change? (No)
What is the highest-risk area?
::1and::which will returnEADDRNOTAVAIL/EAFNOSUPPORTand be silently skipped; no risk.How is that risk mitigated?
checkPortInUse(src/infra/ports-inspect.ts)Current review state
What is the next action?
What is still waiting on author, maintainer, CI, or external proof?
Which bot or reviewer comments were addressed?