parallelize graceful agent drains, serialize container stops on fast lane; unify shutdown+checkpoint+compact prompt

This commit is contained in:
damocles 2026-06-29 19:19:20 +02:00 committed by mara
commit fc42f97691
5 changed files with 189 additions and 60 deletions

View file

@ -517,6 +517,12 @@ ttl_seconds?, to?)`, `answer(id, answer)`.
explicit `from: "graceful-stop"` message instead of an empty inbox.
This unmissably directs the agent to flush durable state (`/state`
files) and end the turn — the container exits when the turn completes.
This is a **single** wake: the graceful-stop turn *is* the checkpoint
(its prompt carries the full notes/CLAUDE.md/TODO.md flush guidance),
so the harness compacts directly afterwards if the context crossed the
watermark (`CompactionMode::CompactOnly`) rather than waking a second
dedicated checkpoint turn. Compacting before shutdown keeps a later
cold start cheap instead of re-uploading a huge transcript.
- `ask` — surface a structured question to the operator (default) or
a peer agent (`to: "<agent>"`). Non-blocking — returns a question
id; the answer arrives as a `question_answered` system event in the