Broker exit request and nix run .#loop for self-updating hosts
- broker: `{"type":"exit"}` answers `exiting`; `sausage run` then stops all
actors and exits with code 75.
- flake: apps `loop` / `loop-internal` run `nix run --refresh git+ssh://.../surma/sausage -- run <world>`
in a loop; exit code 0 (/quit) ends the loop, anything else restarts.
- PROTOCOL.md, README.md, test in cli/tests/host.rs.
Not compiled: written by the Sausage agent, which cannot build the native host.
This commit is contained in:
@@ -23,6 +23,16 @@ the base URL, the model, and the token. It reads `SAUSAGE_API`,
|
||||
values go to `world/actor/agent/data/config.json`. Both commands take another
|
||||
folder as an argument, for example `nix run -- run my-world`.
|
||||
|
||||
To keep a world on the newest version, run it in a loop:
|
||||
|
||||
```sh
|
||||
nix run .#loop -- my-world # or .#loop-internal (Gitea on the LAN)
|
||||
```
|
||||
|
||||
The loop runs `nix run --refresh git+ssh://…/surma/sausage -- run my-world`.
|
||||
When the host crashes or an actor sends `@broker {"type":"exit"}`, the loop
|
||||
fetches the newest commit and starts it again. `/quit` ends the loop.
|
||||
|
||||
In the console:
|
||||
|
||||
```text
|
||||
|
||||
Reference in New Issue
Block a user