StateM Stop Hook Integration and Execution Continuation
StateM supports host-level stop-hook integration for CLI agents (such as Codex and Claude Code) to prevent premature termination during long unattended tasks. When the host environment receives an instruction to stop, the stop hook intercepts the request and inspects the current StateM status:
- If the run is in a designated terminal state or is explicitly blocked on an external dependency, the stop is permitted to proceed.
- Otherwise, the stop hook halts termination, returns the current execution phase along with outstanding unmet obligations to the agent, and requests continued work.
While this mechanism provides greater execution persistence and establishes explicit stopping criteria, it does not provide an absolute correctness guarantee and must remain bounded by time, token, and retry budgets.
0
1
Tags
Prep Sessions
Engineering Deterministic Runtimes and Verification for Autonomous Agents @ University of Michigan - Ann Arbor
Ch.2 Runtime Lifecycle and State Management - Engineering Deterministic Runtimes and Verification for Autonomous Agents @ University of Michigan - Ann Arbor
Per-Run State Persistence, Recovery, and Stop Hooks - Engineering Deterministic Runtimes and Verification for Autonomous Agents @ University of Michigan - Ann Arbor
Learn After
Under which condition does the StateM stop hook permit a termination instruction to proceed?
Integrating StateM stop hooks provides an absolute correctness guarantee for CLI agent executions.
When halting a premature termination request, what two items does the StateM stop hook return to the agent alongside the continuation request?
Explain why host environments must enforce time, token, and retry limits when utilizing StateM stop hooks for unattended CLI agent execution.
Match each StateM integration concept with its corresponding description.
Place the steps in the correct order for how a StateM stop hook processes a termination signal.