docs(examples): kill -9 → resume without re-spending (the flagship) - #62
Merged
Conversation
The crash-resumable moat, made into a recordable, reproducible demo. A checkpointing agent runs under a governed run; the daemon is kill -9'd mid-run; on restart it reloads the run with the budget it had already spent, and re-running the agent (via resume_run) picks up from the last checkpoint and finishes — without redoing the paid steps. demo.sh scripts the whole money shot deterministically: 5 of 10 steps -> kill -9 the daemon -> restart -> resume -> finish, then proves the governor's loop counter is 10, not 15. Key-free: the loop counter is the proof; the README shows the dollar counter behaves identically (Reload restores spent dollars/tokens too). agent.py is the resumable agent — create-or-resume via a run-id file, checkpoint each step, and a clear "the daemon is gone, restart and re-run to resume" message when it can't reach the daemon. Linked prominently from the README as the moat.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The flagship demo
The crash-resumable moat, made into a recordable, reproducible demo (
examples/kill-9-resume/). A checkpointing agent runs under a governed run; the daemon iskill -9’d mid-run; on restart it reloads the run with the budget it had already spent, and re-running the agent (viaresume_run, #61) picks up from its last checkpoint and finishes — without redoing the paid steps.The proof is one number: across the crash the governor’s loop counter ends at 10, not 15.
./demo.sh— the money shot, in one commandScripts it deterministically: start daemon → 5 of 10 steps →
kill -9the daemon → restart (resumed runs from store count=1) → resume from cursor 5 → finish →runs listshowsLOOPS=10.Contents
agent.py— the resumable agent (create-or-resume via a run-id file; checkpoints each step; prints a clear “the daemon is gone — restart and re-run to resume” message when it can’t reach the daemon).demo.sh— the reproducible orchestrator (uses the binary so it cankill -9the process).README.md— one-command run, the by-hand flow for a live recording, how it works, and the “$ not double-counting” note (Reload restores spent dollars/tokens too — shown via the proxy).Verification
Ran
demo.shend-to-end against the built binary + the SDK: 5 steps →kill -9→ restart → resume → finish,LOOPS=10(not 15). Also verified the daemon-crash-mid-run path prints the recovery message.py_compile+bash -nclean.Key-free. No model call, no API key — the loop counter is the proof.