feat: auto-pick a free port in webmux service install - #243
Conversation
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
webmux | aac6f1c | Commit Preview URL Branch Preview URL |
May 19 2026, 07:34 AM |
|
Claude finished @hugocasa's task in 2m 57s —— View job Code Review —
|
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…ision Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
Claude finished @hugocasa's task in 3m 2s —— View job Code Review —
|
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Summary
Second-project
webmux service installno longer silently collides on port 5111. When--portis omitted, the install command scans the live instance registry and the already-installed systemd/launchd unit files for webmux to find a port that isn't already claimed, and writes that port into the new unit file.This builds on the symmetric peer registry from #241: the registry tells us which ports are currently live, the unit-file scan covers installed-but-stopped services that still own their port.
Changes
bin/src/install-ports.ts: purepickFreePort(start, taken)+ thin I/O overreadInstalledServicePorts(parses--port Nout of~/.config/systemd/user/webmux-*.serviceand~/Library/LaunchAgents/com.webmux.*.plist) anddiscoverTakenPortswhich unions those withcreateInstanceRegistry().listLive().bin/src/service.ts:portExplicitflag through the install path.webmux service installis idempotent without re-passing--port.--portflag is supplied and 5111 / the requested start is already taken.--portalways wins, even against a colliding installed unit.pickFreePortboundary cases, both unit-file shapes (systemd, launchd), and the exclude-self-on-reinstall path.Test plan
bun run test— full suite green (backend 350, packages 4, bin 121, frontend 73)tsc --strictover the new bin sources — cleancd ~/projects/foo && webmux service installthencd ~/projects/bar && webmux service install— second install should land on 5112, both services start cleanly, both visible in the InstanceSwitcherGenerated with Claude Code