fabro/lib/apps/fabro-cli/tests/it/scenario
Bryan Helmkamp 1978257aa5
Interrupt a live agent stage's model turn over Petri
Petri 639ce3e added `ControlService::interrupt_firing` and the `LiveTurns`
capability a host installs beside the pause hooks. Fabro now drives it:
`RunControls::interrupt(stage, text)` resolves its stage the way a steer
does (a label, a node name, or the run's one live agent stage) and stops
that stage's current model turn, keeping the session; the text, when
given, is the stage's next input. `engine::run` installs the live-turn set
as a runtime capability, so without it no interrupt could ever land.

The worker maps `run.interrupt` and `run.interrupt_then_steer`, both of
which now carry an optional `stage`, to that call. The control bus is
one-way, so a refusal is recorded the way a refused steer is: a
`run.notice` on the run's stream whose code says why (`no_live_turn` when
Petri refuses a stage with no turn in flight, `no_such_stage`,
`interrupt_refused`).

The server's `POST /runs/{id}/interrupt` and `POST /runs/{id}/steer` with
`interrupt=true` forward the control and answer 202, replacing the 501
`interrupt_unsupported` stub. The interrupt endpoint takes an optional
body (`stage`, `text`), refuses a finished run with 409
`run_not_interruptible`, and forwards an interrupt of a blocked run, since
an agent stage may be running a turn beside the question and the worker
judges each stage itself. `fabro events --pretty` prints the delivered
interrupt and the stage's `attractor.turn.interrupted` report.

Verified on the twin: `fabro steer --interrupt` during a long tool call
ends the turn, the text is the agent's next request, and the stream
carries the `$interrupt` record and the interrupted-turn report; an
interrupt of a gate stage is refused with `no_live_turn` and the gate's
question is untouched.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-18 22:38:17 -04:00
..
archive.rs refactor: organize crates into three layers 2026-07-23 17:59:34 -04:00
artifacts.rs Address artifact review feedback 2026-07-29 16:37:59 -04:00
auth.rs Remove the [server.slatedb] settings and the SlateDB prefix probe 2026-09-18 16:00:24 -04:00
exec.rs refactor: organize crates into three layers 2026-07-23 17:59:34 -04:00
lifecycle.rs Assert the graph name field in local_run_lifecycle 2026-09-14 09:41:05 -06:00
mod.rs Merge branch 'petri-integration-sandbox' into petri-integration 2026-09-18 09:11:19 -04:00
petri.rs Interrupt a live agent stage's model turn over Petri 2026-09-18 22:38:17 -04:00
petri_controls.rs Interrupt a live agent stage's model turn over Petri 2026-09-18 22:38:17 -04:00
petri_docker.rs Checkpoint and recover Petri workspaces inside Docker and Daytona sandboxes 2026-09-18 09:10:29 -04:00
petri_tools.rs Format the Petri test fixtures after the engine key removal 2026-09-18 10:54:45 -04:00
server_lifecycle.rs refactor: organize crates into three layers 2026-07-23 17:59:34 -04:00
smoke.rs Serve the run stream as the only run event API 2026-09-18 13:36:00 -04:00