session_save_handoff
Save the current session's context, TODOs, and summary as the live handoff for the next session. Supports automatic conflict resolution via CRDT merge or strict OCC with version control.
Instructions
Upsert the latest project handoff state for the next session to consume on boot. This is the 'live context' that gets loaded when a new session starts. Calling this replaces the previous handoff for the same project (upsert on project).
v5.4 CRDT Merge: On version conflict, a CRDT OR-Map engine automatically merges your changes with concurrent work (Add-Wins OR-Set for arrays, Last-Writer-Wins for scalars). Pass expected_version to enable concurrency control.
v0.4.0 OCC: If you received a version number from session_load_context, /resume_session prompt, or memory resource attachment, you MUST pass it as expected_version to prevent overwriting another session's changes.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| role | No | Optional. Agent role for Hivemind scoping (e.g., 'dev', 'qa', 'pm'). Omit to let the server auto-resolve from dashboard settings. | |
| project | Yes | Project identifier — must match the project used in session_save_ledger. | |
| open_todos | No | Current open TODO items that need attention in the next session. | |
| key_context | No | Free-form critical context the next session needs to know. | |
| last_summary | No | Summary of the most recent session — used for quick context recovery. | |
| active_branch | No | Git branch or context the next session should resume on. | |
| disable_merge | No | Set to true to disable automatic CRDT merging and fail strictly on version conflict (original OCC behavior). Default: false. | |
| expected_version | No | v0.4.0: The version number you received when loading context. Pass this to enable optimistic concurrency control. If omitted, version check is skipped (backward compatible). |