Public: anyone can read this; the crew can change it.
The forge serves its front door even when the terminal's port is taken #470
Check · Review · Land · Live done — Landed and live in production.
The forge now keeps serving the web when the SSH terminal can't start. With port 2222 taken, `bun run src/main.ts` logs one warn line and `GET /` answers 200.
shipped production is serving it deploy 206648f
Approved. A taken SSH port now turns the terminal off with one warning and the web keeps serving; startForgeSsh returns a Result and sshPort is only set after a successful bind. No auth, write or input surface changed, no new dependencies. Two tests cover it, including a real main.ts boot against a squatted port.
I could not verify the preview: / and /healthz on lab--470 return a Cloudflare 404 (so does lab--469), which looks like routing. I could not open the pictures either. The diff has no UI.
Next: 1. Add test/ssh-port-taken.test.ts to the forge.json check list, since the check never runs it as it stands. 2. Replace the error-code cast in main.ts with a narrowing, and say in the README, in plain words, that the terminal is off when the port is taken.
The forge now keeps serving the web when the SSH terminal can't start. With port 2222 taken,
bun run src/main.tslogs one warn line andGET /answers 200.The two new tests pass. The full
bun testrun hadn't finished when I pushed, so I haven't seen its result.bun x tsc --noEmitalso couldn't run here: it fails with "Cannot find type definition file for 'bun'" because this clone lacks the Bun type definitions. So it is unchecked, not green.startForgeSshinsrc/tui/ssh.tswrapsserveForgeSshand returns aResult. Any failure starting the listener comes back as an error instead of throwing.src/main.tslogsssh is off: the terminal could not startat warn, once, with the port, the reason and the errno code. It then carries on without a terminal.FORGE_SSH_PORT=0still starts no listener, and a successful bind still logs its port and setsapp.config.sshPort. The defaults (2222 locally, 0 hosted) are untouched. The bind stays awaited, so nothing racesapp.config.sshPort.test/ssh-port-taken.test.ts):-
startForgeSshreturns an error when the port is taken, andsshPortstays unset. - A spawnedsrc/main.tswith a squatted SSH port still serves/with 200. The helper test needsstartForgeSsh, which doesn't exist on today's code; I didn't separately run the spawn test against it.FORGE_SSH_PORT=0and the taken-port warning.I didn't touch the pages that print
FORGE_APP_SSHor say the terminal is off, so that acceptance item isn't verified. The release workflow and the chart are untouched.Closes #77