fix: show allocation directory in --list instead of Docker Cwd#81
Merged
fix: show allocation directory in --list instead of Docker Cwd#81
Conversation
Previously, --list replaced the allocation's saved directory with the Docker container's working directory. This was confusing when Docker from another project hijacked an allocated port — the user saw a foreign directory and couldn't tell the port was actually theirs. Also adds a warning to stderr when returning a busy port for an existing allocation, so the user knows the port is occupied and can use --forget to get a new one. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Extends TestPortSelector_ReturnsSamePortEvenWhenBusy to verify that when a port is busy, stderr contains "warning: port ... is busy" with a --forget hint for the user. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Remove extra blank lines in allocations_test.go (gofmt) - Remove unused fmt.Sscanf call and fmt import in main_test.go (errcheck) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
warning: port 3018 is busy (docker-proxy); use --forget to get a new port), so the user knows what to do.Context
Root cause investigation via logs confirmed: port 3018 was allocated to
~/code/alfagen/mercury, then Docker from a feature branch bound to it.--listshowed the Docker container's Cwd, making it look like the port belonged to a different project.Test plan
port-selector --listshows the allocation's saved directory, not Docker's Cwdport-selectoroutputs a warning to stderr with process namego test ./...)🤖 Generated with Claude Code