Skip to content

feat: flash dev auto-selects next available port#213

Merged
KAJdev merged 1 commit intorefactor/flash-dev-no-codegenfrom
zeke/ae-2220-flash-dev-auto-select-next-available-port
Feb 21, 2026
Merged

feat: flash dev auto-selects next available port#213
KAJdev merged 1 commit intorefactor/flash-dev-no-codegenfrom
zeke/ae-2220-flash-dev-auto-select-next-available-port

Conversation

@KAJdev
Copy link
Contributor

@KAJdev KAJdev commented Feb 20, 2026

When the default port (8888) or the user-specified --port is already in use, flash dev now automatically tries the next port, counting up to 20 attempts before failing.

Previously, flash dev would crash with [Errno 48] Address already in use.

Changes:

  • Add _find_available_port(host, start_port) that probes ports via socket.bind() before launching uvicorn
  • If a different port is selected, prints a yellow notice: Port 8888 is in use, using 8889 instead.
  • Fails with a clear error after 20 consecutive ports are exhausted
  • Existing --port / -p flag behavior is unchanged (it sets the starting port)

Closes AE-2220

@KAJdev KAJdev merged commit ad0356d into refactor/flash-dev-no-codegen Feb 21, 2026
@KAJdev KAJdev deleted the zeke/ae-2220-flash-dev-auto-select-next-available-port branch February 21, 2026 00:00
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