Problem
Long-running goal sessions can reach their hard context boundary while work is still open. Same-session compaction helps, but it does not create a successor parent session, so continuation still depends on manual checkpoint/replay.
Expected behavior
Before the parent session reaches its terminal context boundary, Senpi should create exactly one successor parent session and automatically resume it from a durable checkpoint.
The checkpoint should preserve:
- latest user goal and queued steering
- todo item states and active pointer
- cwd, model, and runtime configuration
- child-task/monitor/wakeup references without duplicating work
- predecessor/successor linkage visible to the operator
Safety requirements
- rollover is idempotent under retries and process restart
- no open task is silently promoted to complete
- a failed handoff remains recoverable from the predecessor checkpoint
- live child work is reattached or explicitly marked unavailable, never duplicated silently
- manual checkpoint/replay remains available as a fallback
Acceptance tests
- Simulate a parent session crossing a configurable rollover threshold.
- Verify one successor is created and linked in both directions.
- Verify pending/in-progress/completed todo states and the active pointer are identical after resume.
- Verify a crash between checkpoint creation and successor activation replays exactly once.
- Verify child task and monitor references are restored without duplicate execution.
- Verify the successor continues automatically without requiring the operator to paste a handoff.
Current workaround: bounded manual checkpoint and replay. That mitigates loss but does not satisfy automatic parent-session rollover.
Problem
Long-running goal sessions can reach their hard context boundary while work is still open. Same-session compaction helps, but it does not create a successor parent session, so continuation still depends on manual checkpoint/replay.
Expected behavior
Before the parent session reaches its terminal context boundary, Senpi should create exactly one successor parent session and automatically resume it from a durable checkpoint.
The checkpoint should preserve:
Safety requirements
Acceptance tests
Current workaround: bounded manual checkpoint and replay. That mitigates loss but does not satisfy automatic parent-session rollover.