Repro
PLANNOTATOR_PORT=0 plannotator annotate README.md
Output:
[Plannotator] Warning: Invalid PLANNOTATOR_PORT "0", using default
Expected: no warning. Port 0 means "OS picks random port" — already the local-mode default.
Root cause
packages/server/remote.ts getServerPort() — common to both modes:
if (!isNaN(parsed) && parsed > 0 && parsed < 65536) { // parsed > 0 rejects 0
Port 0 is rejected by validation, printed as warning, then the fallback returns... 0:
return isRemoteSession() ? DEFAULT_REMOTE_PORT : 0; // identical to what was rejected
Fix
- if (!isNaN(parsed) && parsed > 0 && parsed < 65536) {
+ if (!isNaN(parsed) && parsed >= 0 && parsed < 65536) {
One character, one file.
Repro
Output:
Expected: no warning. Port 0 means "OS picks random port" — already the local-mode default.
Root cause
packages/server/remote.tsgetServerPort()— common to both modes:Port 0 is rejected by validation, printed as warning, then the fallback returns...
0:Fix
One character, one file.