Skip to content

fix: report the actual console port for --port 0 - #139

Merged
zzxwill merged 7 commits into
masterfrom
fix/console-assigned-port
Oct 21, 2026
Merged

zzxwill merged 7 commits into
masterfrom
fix/console-assigned-port

Conversation

@zzxwill

@zzxwill zzxwill commented Oct 21, 2026

Copy link
Copy Markdown
Collaborator

When --port 0 asks the operating system to choose a console port, Jury previously opened http://127.0.0.1:0 even though the server was listening on a different port. Return the actual bound port so review and saved-run consoles open a reachable URL.

Regression tests verify literal zero reaches the listener, the reported URL reaches the server, available nonzero requests are preserved, and occupied ports fall back sequentially. CLI tests observe the real listener call without replacing socket behavior. Usage documentation and the changelog describe the behavior.

Validation on d1ba46e0395e65fcf8f0e190edf8e60295d005ac:

  • Fail-before/pass-after reproduction and mutation checks confirm the regressions detect the original bug and incorrect fixed-port substitutions.
  • node --test test/server-port.test.js test/web-launch.test.js: 10 passed.
  • npm test: 272 passed, 0 failed.
  • npm run test:package, npm run package:plugin, and git diff --check origin/master...HEAD: passed.
  • Actual Jury with Codex reviewer and Codex judge configured: exit 0, NO NEW FINDINGS, one round on the unchanged final commit. The reviewer sandbox permitted the four mocked listener tests but denied real sockets/temp fixtures; independent runtime tests passed on the exact same commit.

Portable equivalent of the executed local review command (the recorded invocation used the absolute worktree path and redirected output to an evidence log):

GIT_AUTHOR_NAME=zzxwill GIT_COMMITTER_NAME=zzxwill node bin/jury.js review --dir "$PWD" --trunk master --reviewer codex --judge codex --rounds 2 --summary 'Fix console URLs for --port 0 by reporting the actual listening port. Regression tests observe the CLI-to-listener port argument without replacing socket behavior, verify literal zero reaches the listener, preserve available nonzero requests, and verify sequential fallback with busy neighbors. Independent regression mutations and all 272 tests plus package checks pass on this integrated commit. Review the focused diff for correctness; the unverified package-check hang is outside this fix.' --web=false --push=false

Current master 86fda6713039af50817f4ba29f67d4f8960784f3 was integrated without rewriting history. Final-head remote CI is pending.

@zzxwill
zzxwill marked this pull request as ready for review October 21, 2026 13:46
@zzxwill
zzxwill merged commit 7f10191 into master Oct 21, 2026
8 checks passed
@zzxwill
zzxwill deleted the fix/console-assigned-port branch October 21, 2026 13:46
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