INNER CODE UNIT · TypeScript
StartCommandExit
lidge-jun/opencodex · src/cli/index.ts:260
class StartCommandExit extends Error {
constructor(readonly exitCode: number) {
super(`start command exited with code ${exitCode}`);
this.name = "StartCommandExit";
}
}
async function chooseListenPort(
requestedPort?: number,
options: { sibling?: boolean } = {},
): Promise<number> {
const config = loadConfig();
const preferred = requestedPort ?? config.port ?? 10100;
const hardPin = requestedPort !== undefined && requestedPort > 0;
// Only an EXPLICITLY ported listener reserves a port. The companion form (`{enabled:true}`
// with no port) deliberately shares the public port on 127.0.0.1, so treating it as a
// reservation — via `effectiveLoopbackListenerPort` — would refuse every start on a
// one-port hub and hop the public listener onto an ephemeral port (#4236).