Public: anyone can read this; nobody can change it.

An app's terminal that runs without a cell ends with everything it started, on a hangup or its own exit #66

Merged opened this view on origin

Check · Review · Land done · Live — Landed; nothing deploys from this branch, so this is the end of its path.

Merged

Where the host cannot hold a cell (CI, a pod without bwrap), an app's terminal (`ssh <slug>@forge`, or `t` in the forge's terminal UI) ran as a plain `/bin/sh -c` child in the forge's own process group, and a hangup sent SIGHUP to the program's pid alone. What the program had started (a server it left running, a job sent to the background) was re-parented and kept running in the deployed checkout,…

shipped merged

opened this view on origin

Where the host cannot hold a cell (CI, a pod without bwrap), an app's terminal (ssh <slug>@forge, or t in the forge's terminal UI) ran as a plain /bin/sh -c child in the forge's own process group, and a hangup sent SIGHUP to the program's pid alone. What the program had started (a server it left running, a job sent to the background) was re-parented and kept running in the deployed checkout, with the environment's data dir, forge token and secrets, after the terminal had closed; nothing ever stopped it.

The terminal now leads a process group of its own (detached, without a cell only), a hangup signals the group, and once the program has exited, what is left of the group is killed: the pattern #63 and #64 gave apps and steps. The spawn moves into startTerminal, so it is tested without a deploy. A cell is unchanged: its tree dies with bubblewrap. signalGroup is exported from apps/process.ts for it.

<!-- pipeline:validation -->

Validation

pipeline/validate on a97b8e6b: baseline in 594s — bun 1.3.14, CI-shaped env (scrubbed vars, runner PATH), exact check.yml shard + forge.json commands.

stepresulttime
bun install --frozen-lockfileok (exit 0)0s
forge.json check.fastBASELINE (exit 1)118s
check.yml gate (1) pull_requestBASELINE (exit 1)14s
check.yml gate (2) pull_requestok (exit 0)268s
check.yml gate (3) pull_requestok (exit 0)194s
  • ⚠️ node v20.19.2 here, v22 on CI (tsc runs under node)
  • ⚠️ check.yml gate (1) pull_request stopped early at a BASELINE failure (fail-fast): its later files were not run in this step
test output (failures, totals)
▶ bun install --frozen-lockfile
  ok  exit 0  0s
▶ forge.json check.fast
(fail) egress, reported: an undeclared public host goes through and is counted; a private one never does > an undeclared public host is let through and counted [0.98ms] [shard 10]
Ran 2571 tests across 260 files in 98.8s; 1 failed.
classify: reran test/contain.test.ts test/subscriptions.test.ts test/watches.test.ts  alone on origin/main 5881c081 and on this branch
  BASELINE  exit 1  118s
▶ check.yml gate (1) pull_request
(fail) egress, reported: an undeclared public host goes through and is counted; a private one never does > an undeclared public host is let through and counted [1.40ms] [shard 3]
Ran 113 tests across 3 files in 14.2s; 1 failed.
classify: reran test/contain.test.ts  alone on origin/main 5881c081 and on this branch
  BASELINE  exit 1  14s
▶ check.yml gate (2) pull_request
Ran 1339 tests across 137 files in 267.7s (137 shards).
  ok  exit 0  268s
▶ check.yml gate (3) pull_request
Ran 1502 tests across 137 files in 193.2s (137 shards).
  ok  exit 0  194s
Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs