agent-loop lifecycle: dispose drains machine.done to true quiescence. cancel()'s own running-to-idle transition can legitimately re-enter through an automation listener (goal-session's idle drive runs synchronously to its first await) and replace done with a fresh admission after the single capture; teardown now re-cancels and re-awaits until the slot stabilizes, so the scope never unwinds under a live run. tools: a nested concludeTurn() stages on its own execution and promotes to the enclosing composite only on the call's authoritative successful verdict. A post-execute policy that converts the nested success into an error no longer lets a recovering composite stop the turn on a failed terminal operation (the Code Mode structured-output shape). goal-session: the driver owns its round durability barrier again. The loop's persistence is eager write-behind with no turn-end flush, so the old post-turn agent/error signal for flush failures never fires; a settled round now sets needsCheckpoint and re-enters drive, flushing before the next reservation and disarming on failure instead of queueing an autonomous round on state that was never persisted.
goal/ — persisted same-session goals
English | 中文
The goal family owns durable objective state independently of the model-facing tools and continuation policy that consume it.
| Package | Role | ctx key |
|---|---|---|
goal/ |
Event-sourced goal lifecycle, replay fold, compare-and-set mutations, and process-local activation | ctx.goals |
goal-session/ |
Same-session goal-round admission, outcome mapping, and lifecycle race fencing | — |
tool-goal/ |
Model-facing read/create/update tools with execution-time authority checks | — |
command-goal/ |
Human-facing /goal status and lifecycle control over the command plane |
— |
Goal state is part of the owning session log. Consumers depend on dsh-goal, not on the concrete agent loop; continuation behavior belongs in a separate plugin on the public agent seams.