fabro/lib/apps/fabro-server/tests/it/api
Bryan Helmkamp b5ebb472ae
Launch a worker for a Petri run and resume it after a server restart
`execute_run` no longer runs a Petri run in the server process by default:
it takes the subprocess path a legacy run takes, and `worker_exited` still
releases the worker's lease when the process ends. The in-process path
stays under the handler-registry test override, so the scenario tests need
no worker binary; it now honours the managed run's execution mode.

At startup, `reconcile_incomplete_runs_on_startup` hands a Petri run the
previous server left in flight (runnable, starting, running, blocked or
paused, with no cancel pending) back to a worker instead of failing it:
`PetriRuns::release_for_restart` ends the dead worker's lease from outside,
which fences it should it still be alive, the run is asked to start again
as a resume (`run.start_requested` with `resume`, then `run.runnable`, the
pair the API's resume appends), and the managed run is registered in
resume mode when Petri's store holds the run, else in start mode. Full
workspace recovery is the plan's F3.5 and is noted in the module docs.

Tests: the restart reconcile releases the lease, rewrites the history, and
launches the worker with `--mode resume`; a worker's HTTP store leases for
its launch id over the loopback server.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-17 21:20:22 -04:00
..
auth_sessions.rs Remove stale auth-session test import 2026-08-24 14:40:38 -04:00
automations.rs Align remote workflow selectors with run targets 2026-08-31 17:13:20 -04:00
cli_auth_token.rs Keep retired Slate helpers test-only 2026-08-24 17:31:15 -04:00
compression.rs refactor: organize crates into three layers 2026-07-23 17:59:34 -04:00
docs.rs refactor: organize crates into three layers 2026-07-23 17:59:34 -04:00
environments.rs Require a server-managed environment for automations 2026-08-30 09:58:13 -04:00
events.rs Retire legacy manifest run creation 2026-09-13 08:49:50 -06:00
install.rs Merge origin/main into the sandbox-driver adoption 2026-09-10 13:37:11 -06:00
install_openai_compatible.rs refactor: organize crates into three layers 2026-07-23 17:59:34 -04:00
mcp_servers.rs refactor: organize crates into three layers 2026-07-23 17:59:34 -04:00
mod.rs Check the HTTP run store against a loopback server 2026-09-17 20:12:20 -04:00
petri_store.rs Launch a worker for a Petri run and resume it after a server restart 2026-09-17 21:20:22 -04:00
routing.rs refactor: organize crates into three layers 2026-07-23 17:59:34 -04:00
run_files.rs Add the engine flag and record the engine on the run spec 2026-09-17 20:02:47 -04:00
runs.rs Retire legacy manifest run creation 2026-09-13 08:49:50 -06:00
sandbox_vnc.rs Retire legacy manifest run creation 2026-09-13 08:49:50 -06:00
sessions.rs Retire legacy manifest run creation 2026-09-13 08:49:50 -06:00
settings.rs refactor: organize crates into three layers 2026-07-23 17:59:34 -04:00
system.rs Retire legacy manifest run creation 2026-09-13 08:49:50 -06:00
tcp.rs Add the engine flag and record the engine on the run spec 2026-09-17 20:02:47 -04:00
variables.rs Retire legacy manifest run creation 2026-09-13 08:49:50 -06:00