You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
feat: Use incremental port assignment (like Vite) instead of random OS-assigned ports #10357
When starting multiple OpenCode web servers and the default port 4096 is already in use, the server currently falls back to a random OS-assigned port (e.g., 55651). This makes it difficult to predict which port the server will use.
Expected Behavior
The server should try incremental ports (4096, 4097, 4098, etc.) similar to how Vite handles port conflicts. This provides a predictable port sequence and better developer experience.
Current Behavior
First server: Port 4096 ✓
Second server: Random port (e.g., 55651) ✗
Proposed Solution
When port is occupied, try incremental ports up to 10 attempts before falling back to OS-assigned port:
First server: Port 4096
Second server: Port 4097
Third server: Port 4098
etc.
This should work for both default port (4096) and custom ports specified via --port flag.
Category
Missing standard behavior - improves UX to match common dev server patterns (Vite, Next.js, etc.)
Activity
github-actions commentedon Mar 27, 2026
To stay organized issues are automatically closed after 90 days of no activity. If the issue is still relevant please open a new one.