OpenCode Windows CLI fails on WSL2 mirrored networking: port 45278 falsely reported as in use
zhpengsy · ghdev · 2026-10-16
A bug report against OpenCode 2.0.30's native Windows CLI describes startup failures on machines running WSL2 with mirrored networking: the managed service claims 127.0.0.1:45278 is in use, yet no process or connection appears in Windows or WSL networking tools.
Key findings from the investigation:
- Port 45278 falls inside the WSL2 mirrored-mode ephemeral port range 44620–48715
- An independent .NET TCP listener test also fails with SocketException 10048 (AddressAlreadyInUse); nearby ports 45279/45000/46000/47000 fail too, while 43000/44000/18080 bind fine
- The port is not listed in netsh's excluded port ranges
The author concludes this matches WSL mirrored mode's HNS ephemeral port reservation behavior (microsoft/WSL#40169): the port is reserved by the system with no actual process occupying it, making OpenCode's error message misleading. Workaround: opencode service set port 18080. The report suggests OpenCode should detect usable ports automatically and mention system reservations in its error.
More from coding & agent
- Index Network open-sources Social Discovery Protocol: agents negotiate fit on your behalf — carsonfarmer · 2026-10-23
- Installed a formal-verification skill: it silently installed Java, MacBook runs 10 degrees hotter — zealcaiden · 2026-10-23
- OpenAI's Decisions API hits GA: near real-time routing up to 10x faster than GPT-6 Luna — OpenAIDevs · 2026-10-23
- Ruff author warns: upgrade Node/Bun now — --use-system-ca still accepts the eMudhra cert — charliermarsh · 2026-10-23
- Proof of Agent: paste one prompt and your AI mines, grades, and self-governs — adamamcbride · 2026-10-23
- DeepLearning.AI weekly: GPT-6.1 hits 97.9% byte parity on COBOL migration — DeepLearningAI · 2026-10-23