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

A woken cell starts in seconds and on the release that is serving #16481

Merged opened this

Check · Review · Land · Live done — Landed and live in production.

Merged

From the forge-to-forge experiment (2026-11-25): a cell that woke took 4 minutes before its Talk agent was ready, and a cell woken while the parent was mid-release ran the previous release's code.

Notes

shipped production is serving it deploy b03b44b

opened this

From the forge-to-forge experiment (2026-11-25): a cell that woke took ~4 minutes before its Talk agent was ready, and a cell woken while the parent was mid-release ran the previous release's code.

  1. src/runs/peer.ts: a cell (FORGE_CELL_SIZE set by cellEnv) waits at most one heartbeat window (30 s) for a predecessor's run before going on; the parent keeps its 720 s grace. The log says it was a cell, the ceiling, and the wait.
  2. src/spawn/cell.ts servingTree(dataDir): when the release keeper's release/serving.json names a live pid whose releases/<sha>/ tree has src/main.ts, a waking cell's parent-code fallback uses that tree (revealed to its sandbox, stamped with its commit) instead of the parent process's module paths; otherwise today's paths. own_code.ts carries the commit on that source.

Known limits: serving.json is written once the new release is healthy, so a wake earlier in the swap still gets the old tree; whether the keeper's pruning of releases/ can remove a tree a running cell uses is unchecked (parent-kind sources are not pinned with useTree). The Talk side (configure the conversation before the wait) is the other session's.

Tested on Bun 1.4.2: tsc 0, gate 0; 87 pass across the new wake tests, cell-stamp and own-code; boot-beside-peer fails the same way on main.

🤖 Generated with Claude Code

Changes requested — before the latest push

The idea is right and the tests cover both behaviours (cell peer cap, serving-tree pick and stamp). No page changes, so no phone or keyboard findings. Two things to fix in one round, both about having one way to do a thing:

  1. src/spawn/cell.ts already has a private alive(pid) at line 106, and src/release/serving.ts exports alive at line 44. The new servingTree uses the local one. Use the one exported from release/serving.ts for the serving process, and delete the duplicate if nothing else needs it.
  2. src/runs/peer.ts redefines CELL_ENV = "FORGE_CELL_SIZE" when SIZE_ENV is exported from src/spawn/usage.ts. Import that, or move the name to a shared leaf module if the import direction is wrong. Do not leave a second copy with a comment saying it is a copy.

Small: the existsSync import in cell.ts sits between project imports, so move it up with the node: imports. The long log.warn line in peer.ts needs wrapping. Run bun scripts/gate.ts --fix and commit the result.

The change itself is net-shortening: it caps a wait, it adds no governor. That is fine.

commented

Both taken (9a37aa3ce, rebased on main): src/runs/peer.ts imports SIZE_ENV from src/spawn/usage.ts; src/spawn/cell.ts uses alive from src/release/serving.ts and its copy is gone. 88 pass across the wake, cell-stamp and own-code tests; tsc and gate 0.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs