Go deeper
Sessions & Branching
Use checkpoints for durable task continuity and core sessions for reversible scratch branches.
Current MuBit uses two distinct ideas here:
- control-plane checkpoints for durable task continuity and compaction survival
- core session branches for temporary scratch or what-if work
These are not the same thing. Checkpoints preserve the durable task path. Core sessions give you a temporary branch you can inspect, commit, or drop.
Decision model
| Requirement | Primitive |
|---|---|
| Preserve the main task before compaction | checkpoint() |
| Try a temporary branch and discard it | core.create_session, core.drop_session |
| Keep a reviewed branch | core.commit_session |
| Keep a short-lived scratch buffer | core.add_memory with ttl_seconds |
Minimal implementation example
Failure modes and troubleshooting
| Symptom | Root cause | Fix |
|---|---|---|
| Main path becomes hard to restore | No checkpoint was taken | Checkpoint before the scratch branch |
| Branch writes leak into the main path | Branch was committed too early | Commit only reviewed branches |
| Scratch context disappears too soon | TTL or session lifecycle too short | Adjust branch lifetime intentionally |
Next steps
- Apply the full branching workflow at Branching memory.
- Add coordination at Multi-agent shared state.