Skip to content

feat: dynamic free port for Command Code proxy - #5

Closed
sdziupin wants to merge 1 commit into
feat/live-matrix-36ebfrom
feat/dynamic-proxy-port-36eb
Closed

sdziupin wants to merge 1 commit into
feat/live-matrix-36ebfrom
feat/dynamic-proxy-port-36eb

Conversation

@sdziupin

@sdziupin sdziupin commented Aug 8, 2026

Copy link
Copy Markdown
Contributor

Makes the local Command Code proxy port dynamic.

Behavior

  • Prefer 8797 when free
  • If busy → scan upward (8798…)
  • If the scan range is exhausted → OS ephemeral (port: 0)
  • OPENCODE_COMMANDCODE_PROXY_PORT still pins an exact port (with healthy reuse)

Important fix

config() now starts the proxy before seeding provider.options.baseURL, so OpenCode always points at the live listener after a dynamic bind.

Tests

  • Smoke covers “8797 occupied → another port”
  • Live + OpenCode CLI re-checked green

Stacked on feat/live-matrix-36eb.

Open in Web Open in Cursor 

Prefer 8797, then scan upward (or OS ephemeral) when busy. Env
OPENCODE_COMMANDCODE_PROXY_PORT still pins an exact port. Start the
proxy before seeding provider baseURL so OpenCode hits the live listener.

Co-authored-by: Serhii Dziupin <makeittech@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant