host: add supervisor-gated clean core.restart RPC
Return success before scheduling the existing shutdown path, coalesce pending requests, and mark #loop invocations with SAUSAGE_LOOP=1. Keep core.exit compatibility and document explicit per-call approval for all agents. Card: SAU-134
This commit is contained in:
@@ -80,7 +80,7 @@
|
||||
# `nix run .#loop -- <world>` runs the newest `sausage run <world>`
|
||||
# (without a folder: bare `sausage`, i.e. ./world, created if needed)
|
||||
# from the public repo, again and again: after a crash or a call of
|
||||
# `core.exit` it refreshes the flake and starts the host again, so
|
||||
# `core.restart` (exit code 75) it refreshes the flake and starts the host again, so
|
||||
# the world updates itself. `quit` (exit code 0) ends the loop.
|
||||
# SAUSAGE_FLAKE overrides where it fetches from (any flake URL,
|
||||
# e.g. a fork or a local checkout).
|
||||
@@ -90,7 +90,7 @@
|
||||
# No folder: bare `sausage` (creates ./world first if needed).
|
||||
if [ $# -gt 0 ]; then set -- run "$@"; fi
|
||||
while true; do
|
||||
nix run --refresh "$url#default" -- "$@"
|
||||
SAUSAGE_LOOP=1 nix run --refresh "$url#default" -- "$@"
|
||||
code=$?
|
||||
if [ "$code" -eq 0 ]; then exit 0; fi
|
||||
echo "sausage-loop: sausage exited with $code, starting the newest version in 2 s …" >&2
|
||||
|
||||
Reference in New Issue
Block a user