fix(ENG-2114): Fix port conflicts for concurrent daemon/WUI instances #582
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.
What problem(s) was I solving?
This PR fixes critical port allocation bugs that prevented multiple concurrent daemon/WUI instances from running reliably. These bugs were introduced in #573 and discovered when testing multiple
make codelayer-dev TICKET=ENG-XXXXsessions.Issue 1: IPv6 port detection failure
Issue 2: Overlapping port ranges
Issue 3: Port recalculation conflicts
Issue 4: Debug panel visibility
Related to: ENG-2114
What user-facing changes did I ship?
Port Allocation
make codelayer-dev TICKET=ENG-XXXXsessions now work reliably without conflictsDebug Panel
http://localhost:22119) instead of "Not connected"How I implemented it
IPv6-Aware Port Detection (
hack/port-utils.sh)lsofoverncas it correctly detects both IPv4 and IPv6 bindingsSeparated Port Ranges
Port Parameter Passing (
Makefile)codelayer-devcalculates ports once and passes them to sub-targetsdaemon-ticketandwui-ticketaccept PORT and VITE_PORT parametersbun run tauri devcommand syntaxDebug Panel Fix (
humanlayer-wui/src/components/DebugPanel.tsx)getDaemonUrl()to fetch actual daemon URL from all sourcesVITE_HUMANLAYER_DAEMON_URL) properlyHow to verify it
make checkpassesmake testpasses (4 unrelated Python tests failing - not affected by these changes)Manual Testing
Test concurrent instances:
Verify debug panel:
Test port detection:
make test-port-allocation TICKET=ENG-2119 # Should show available port considering both IPv4 and IPv6Description for the changelog
Fixed critical port allocation bugs preventing concurrent daemon/WUI instances: IPv6-aware port detection, separated daemon/Vite port ranges, consistent port assignment via parameters, and corrected debug panel daemon URL display.