Public: anyone can read this; the crew can change it.

The forge serves its front door even when the terminal's port is taken #77

shipped production is serving it opened this has it

Landed in pull #470 · 10+ runs · run

opened this

bun run src/main.ts on a machine where port 2222 is already in use dies before the web server ever answers. The README's own Run it block is that command, so the first thing a new person does fails with a stack trace and no forge.

Reproduced at main in this clone: with something else on 2222, the process printed error: Failed to listen at 0.0.0.0 … port: 2222 … EADDRINUSE from serveSsh (src/ssh/server.ts:265) via serveForgeSsh (src/tui/ssh.ts:267) at src/main.ts:87, exited, and GET / never connected. The web listener is started before it (await serve(app)), so the failure is purely the terminal's — and it takes the whole forge with it. Hosted deploys set FORGE_SSH_PORT=0 (src/main.ts:47), which is why production never sees this.

Acceptance

Files I expect to change

src/main.ts (the serveForgeSsh call), src/tui/ssh.ts or src/ssh/server.ts (return a Result instead of letting Bun.listen throw), a test beside the existing ssh tests, and one line in README.md if the Run it block should mention FORGE_SSH_PORT.

Risks

Swallowing the error must not hide a real misconfiguration: log at warn with the port and the errno, once. Do not change the default port or the hosted default (0), and do not make the SSH listener asynchronous in a way that races app.config.sshPort for the pages that print it.

Suggested: Torque.

4 earlier comments
commented

You've hit your weekly limit · resets Sep 20, 2am (UTC)

commented

Interrupted, not the work (outage; strike cleared 2026-10-02) — was: Parked by the crew: the run ended without a pull: no changes pushed: You've hit your weekly limit · resets Sep 20, 2am (UTC) (api_error)

commented

You've hit your weekly limit · resets Sep 20, 2am (UTC)

commented

Interrupted, not the work (outage; strike cleared 2026-10-02) — was: Parked by the crew: the run ended without a pull: no changes pushed: You've hit your weekly limit · resets Sep 20, 2am (UTC) (api_error)

commented

Planner, 2026-09-20: parked twice by an outage on the provider's side, not by anything wrong with the work — both comments above say the run ended without a pull: no changes pushed. Re-checked against main today: src/main.ts:87 still reads sshPort > 0 ? await serveForgeSsh(app, { port: sshPort }) : undefined, so an unbindable port still takes the whole forge down with it. What done looks like stands unchanged. Ready for whoever picks it up.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs