feat(lanes): prime and nudge codex lanes into declaring their own stage

A codex lane's declared stage has always depended entirely on the session
reading AGENTS.md and calling `ccam stage` on its own — no hook, no wrapper,
no enforcement. Two additions make that more reliable without touching the
declared-wins / inferred-never-done invariants:

- LaneConsolePane pre-fills a codex pane's opening prompt with a plain-text
  stage-declaration checklist built from the lane's own pipeline_nodes —
  the same up-front priming a Claude lane gets from its pre-filled
  /ccam:ship-feature-lane skill command, just as prose since Codex has no
  slash commands.
- server/lib/codex-nudge.js sweeps every 60s and types a one-line reminder
  into a lane's live tmux pane (tmux.sendText, a new literal-text primitive
  alongside sendCommand) when its fresh detected_stage has sat undeclared
  for over two minutes. It never writes stage/detected_stage itself — any
  resulting declaration is still the codex session's own real ccam stage
  call, just server-prompted instead of relying on memory alone.

server 1354/1354, client 449/449, tsc clean.
This commit is contained in:
2026-08-28 15:59:22 +07:00
parent 5c297c6483
commit 8bd74a57e6
14 changed files with 388 additions and 10 deletions
+17 -1
View File
@@ -77,7 +77,23 @@ Codex's own on-disk rollout journals rather than from hooks — see "Stage
detection" below. What a codex lane cannot get for free is a *declared* stage:
the run console never pre-fills a Claude slash command into a codex pane (Codex
would read `/ccam:ship-feature-lane` as prose), so a codex session declares
stages only when something in the repository — an `AGENTS.md` — tells it to.
stages only when something tells it to. Two things do:
- **An opening prompt checklist.** The Run Setup panel pre-fills a codex pane's
first prompt with a plain-text list of `ccam stage <stage> --tool codex`
calls to make, one per node of the lane's own pipeline template (built from
`Lane.pipeline_nodes`, so it always matches whatever template is in use) —
the same up-front priming a Claude lane gets from its pre-filled
`/ccam:ship-feature-lane` skill command, just as plain text since Codex has
no slash commands. See `LaneConsolePane.tsx`'s `promptPrefill`.
- **A stale-detection nudge.** `server/lib/codex-nudge.js` sweeps every 60s
(`DASHBOARD_CODEX_NUDGE_MS` to change, `0` to disable) for a codex lane whose
fresh, non-stale `detected_stage` has sat ahead of its declared `stage` for
at least two minutes, and types a one-line `[ccam] ... run: ccam stage ...`
reminder straight into that lane's live tmux pane (`tmux.sendText`, skipped
if the pane is at a bare shell prompt). It never writes `stage` or
`detected_stage` itself — declared-wins and inferred-never-`done` are
untouched — it only prods the session into making the real declaration.
## Destructive lane actions