Skip to content

Simplify the dynamic-port announcement follow-up to #204 - #206

Merged
ccomb merged 3 commits into
mainfrom
followup/pr204-simplify-port-await
Jul 14, 2026
Merged

Simplify the dynamic-port announcement follow-up to #204#206
ccomb merged 3 commits into
mainfrom
followup/pr204-simplify-port-await

Conversation

@ccomb

@ccomb ccomb commented Jul 14, 2026

Copy link
Copy Markdown
Owner

Summary

Follow-up to the post-merge review of #204.

  • _await_bound_port now lets the reader thread do the parsing and relies on thread.join(timeout): the engine's death closes stdout and ends the thread, so the queue, the manual deadline loop and the process.poll() check were three error paths for the same condition. Same guarantees, a third less code.
  • A non-numeric VOLCA_PORT= value now raises the same clear RuntimeError as an out-of-range one, instead of leaking a bare ValueError. Covered by a new test parameter.
  • The --port help text and the changelog now say that port 0 binds the loopback interface only — Warp's openFreePort binds 127.0.0.1, unlike the fixed-port path which listens on all interfaces. Without this note the narrower bind is a silent behavior difference.

Verification

  • pyvolca: 233 passed, 7 skipped
  • pyright on server.py: 0 errors, 0 warnings

ccomb added 3 commits July 14, 2026 18:24
The reader thread already ends when the engine dies (stdout closes),
so a plain thread.join(timeout) covers everything the queue, the
manual deadline loop and the process.poll() check were doing. Fewer
error paths, same guarantees.

Also reject a non-numeric VOLCA_PORT= value with the same clear
RuntimeError instead of leaking a bare ValueError, and always pass
text=True to Popen since it has no effect when stdout is DEVNULL.
Warp's openFreePort binds 127.0.0.1, unlike the fixed-port path which
listens on all interfaces. Say so in the --port help text and the
changelog so nobody expects an externally reachable server from
--port 0.
str.isdigit accepts Unicode digits such as superscripts that int()
rejects, so a line like VOLCA_PORT=² still leaked a bare ValueError —
the exact failure this branch set out to close. Every character
accepted by isdecimal is parseable by int(), so the RuntimeError
guarantee now holds for any input.
@ccomb
ccomb merged commit 65921a2 into main Jul 14, 2026
11 checks passed
@ccomb
ccomb deleted the followup/pr204-simplify-port-await branch July 14, 2026 19:01
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