Expand description
The handoff an agent leaves before a user action restarts its session (SPEC_AGENT_PREP_BEFORE_SESSION_RESTART_2026_11_14.md §3.4).
One slot per agent, in its global agent:<defId>:current zone beside the
running summary, so it survives account and channel changes and an srv
restart. It is written when the agent answers Agents ready and read, once,
by the spawn that starts the new session: the first section of the
continuation packet when there is one, else a held note on the session’s
first message.
A second handoff replaces one nobody has read yet: the agent wrote it with the first in its context, because no restart happened in between. A handoff nobody read within a day is dropped.
Structs§
- Handoff
- What the agent left, and under which request.
Constants§
- HANDOFF_
FILE - The slot, in the agent’s zone.
- MAX_
CHARS - Most characters a handoff keeps.
- NOTE_
KEY - The key the note is held under, so a newer handoff replaces it.
Functions§
- clamp
- Keep the head of
textwithinMAX_CHARS, on a line boundary when one is near. - drop_
for_ request - Drop the handoff of request
prep_id(the change was cancelled), and only that one. - store
- Leave
handofffor the agentdef_id’s next session, replacing one not yet read. - take
- The handoff waiting for the agent
def_id’s next session, which reads it once.