GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — fix(cli): default the Windows service to port 45278 by Hona · Pull Request #55547 · anomalyco/opencode

Conversation

@Hona

@Hona Hona commented Oct 14, 2026 •
edited by opencode-agent Bot
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

Issue for this PR

Closes #53351

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

What does this PR do?

  • Windows uses 0xC000-0xFFFF (49152-65535) for outgoing connections, and Hyper-V and WinNAT reserve 100-port blocks of that range at boot. The default service port 0xC0DE (49374) is inside it, so on some boots serve --service fails with "already in use by another process" while nothing listens on the port.
  • On Windows, a default port in that range moves into the 0xB000 block and keeps its low 12 bits. The release default becomes 0xB0DE (45278), which is 0xC0DE - 4096, a nod to the v1 port.
  • macOS, Linux, and WSL keep 49374. A configured port still wins on every platform.
if (platform === "win32" && port >= 0xc000) return 0xb000 | (port & 0xfff)
Channel macOS / Linux / WSL Windows
Release (latest, dev, beta, next) 0xC0DE (49374) 0xB0DE (45278)
local 0xC0DF (49375) 0xB0DF (45279)
Preview hash of the channel same hash, moved below 0xC000 when needed

IANA lists 45278 as unassigned (block 45186-45513).

Upgrade impact on Windows

  • Local clients: The TUI, desktop app, and CLI read the service URL from the registration file, so they follow the new port with no change.
  • Remote access: OpenTunnel targets the port the service binds, so remote URLs keep working.
  • Saved :49374 URLs: Browser bookmarks, devices paired over the LAN, and SSH forwards to a Windows host stop working. Users pair again, or keep the old port with opencode service set port 49374.
  • WSL: Windows and WSL no longer share a default port (related: service: hardcoded default port 49374 locks out any second client on shared loopback (multi-user/WSL mirrored), surfacing only a generic timeout #50672).

How did you verify your code works?

Unit tests pin the Windows defaults, check that 200 preview channels land in 10000-49151 on Windows, and check that ports already below 0xC000 do not change.

Screenshots / recordings

Not a UI change.

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

Added by the opencode bot (AI-generated).

Related: #52234, #50672

Public API: changes the default service port on Windows from 49374 to 45278 (local: 49375 → 45279); a configured port still wins, and saved :49374 URLs on Windows hosts stop working

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Hona added 2 commits October 15, 2026 08:20
@Hona
fix(cli): default the Windows service to port 45278
58900f4
Windows uses 49152-65535 for outgoing connections, and Hyper-V and WinNAT reserve blocks of that range at boot, so the default service port 49374 (0xC0DE) can fail as in use while nothing listens on it. On Windows, default ports in that range move into the 0xB000 block and keep their low 12 bits, so 0xC0DE becomes 0xB0DE (45278), which is 0xC0DE - 4096. Other platforms keep 49374, and a configured port still wins.
@Hona
docs(www): shorten the Windows port note
094482a
@Hona
Hona marked this pull request as ready for review October 14, 2026 22:26
Copilot AI balanced review requested due to automatic review settings October 14, 2026 22:26
Copilot AI reviewed Oct 14, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
opencode-agent[bot]
opencode-agent Bot reviewed Oct 14, 2026
View reviewed changes

@opencode-agent opencode-agent Bot left a comment

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The change looks sound. I couldn't reproduce the bug because it only happens on Windows. I checked that defaultPort returns 45278/45279 for win32 and still returns 49374 on Linux and macOS. The service tests (25/25) and the packages/cli typecheck pass.

Public API: the default service port changes on Windows from 49374 to 45278 (local: 49375 → 45279). Preview channels that hashed to 0xC000 or above also move below it on Windows. Config keys, CLI commands and file formats are unchanged. Local clients follow the port through the registration file. Saved :49374 URLs, paired devices and SSH forwards to Windows hosts stop working until users pair again or run opencode service set port 49374. The description already covers this.

Not blocking: WSL keeps 49374. With WSL2 mirrored networking, Windows' reserved port ranges also apply inside WSL, so those users can still hit this (#52234 is a report from WSL2). A fallback when the port can't be bound would cover that case, and is left for #52234 and #50672.

Related: #52234, #50672

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@Hona
Hona merged commit 3943b84 into anomalyco:dev Oct 14, 2026
11 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@github-actions github-actions Bot mentioned this pull request Oct 14, 2026
📊 AI CLI 工具社区动态日报 2026-10-15 litang9/big_model_radar#551
Open
@rekram1-node rekram1-node mentioned this pull request Oct 14, 2026
promote dev -> prod #55564
Merged
@opencode-agent opencode-agent Bot mentioned this pull request Oct 16, 2026
Windows CLI: WSL2 镜像网络预留范围内的 45278 导致服务启动失败,端口查询无占用记录 #55918
Closed
@zhangzp0127 zhangzp0127 mentioned this pull request Oct 20, 2026
desktop: background service spawn fails "port in use" on Windows/WSL2 mirrored networking — app stuck at logo, error not logged #55907
Closed
@neriousy neriousy mentioned this pull request Oct 20, 2026
fix(cli): move the Windows service port out of the WSL mirrored range #57428
Merged
3 of 6 tasks
@opencodejr opencodejr Bot mentioned this pull request Nov 7, 2026
docs: WSL default port 49374 falls inside Windows reserved range, so pair links fail in a Windows browser #62532
Open
@igorsaevets igorsaevets mentioned this pull request Nov 28, 2026
service: Windows-reserved (excluded) port is reported as "already in use by another process" #66963
Open
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

Copilot code review Copilot
Copilot review effort
Applies to this pull request for everyone.Learn more about Copilot code review.
Copilot left review comments
@opencode-agent opencode-agent[bot] opencode-agent[bot] left review comments

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Windows: managed service fails when default port 49374 is in an excluded TCP range

Uh oh!

There was an error while loading. Please reload this page.

2 participants

@Hona
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.