Skip to main content

Module continuity_state

Module continuity_state 

Source
Expand description

Rolling state block (SPEC_DURABLE_CONVERSATION_MEMORY_2026_09_23.md §4.4, “Generation”). The continuation packet (continuity.rs) carries the recent exchange verbatim; this keeps a running summary of the whole conversation, so a fresh session that can’t resume (an account switch, say) also learns the goal, what’s done, what’s pending and what the user prefers from before the verbatim tail begins.

Updated off the launch path: after a successful turn, when enough has happened since the last version, one Haiku call folds the new turns into the previous state. At most one update runs per agent. Each update is an immutable version appended to [STATE_FILE] in the agent’s global agent:<defId>:current zone, so it survives account and channel changes the same way the transcript does. A failed update (the account is out of quota, say) leaves the last good version in place.

Functions§

running_summary_section
The agent’s running summary as the section a compaction delivery carries last — the SessionStart hook’s (memory_delivery), formatted exactly as the hidden reinjection’s. None when the agent has no summary yet.
with_state_after_compaction
message with the agent’s running summary added, when it is the hidden memory reinjection sent after a compaction (§4.4, “Compaction reuse”): the provider’s own compaction summary can drop commitments, and this is the backstop. Any other message, or an agent with no summary yet, comes back unchanged.