mirror of
https://github.com/garrytan/gstack.git
synced 2026-09-09 14:38:59 +02:00
RANDOM_PORT_MAX was 60000 while the module header documents 49152-65535 as the pool to avoid — ~22% of allocations landed back inside it, preserving the phantom-404 squatting class for both the daemon and the weeks-lived terminal-agent. The cap is now 49151 and the range test pins the true property (< 49152) instead of the old <= 60000 tautology. terminal-agent boot also re-allocates and retries up to 5 times when Bun.serve throws in the probe-then-bind TOCTOU window — previously a concurrent bind killed the boot with no retry via main().catch → exit 1. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>