code-yeongyu / code-yeongyu/senpi

feat(runtime): automatic parent-session rollover with resumable state

Open
#1,081 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
429
Forks
98
Avg merge
5h 3m
Merged PRs (30d)
526

Description

## 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
1. Simulate a parent session crossing a configurable rollover threshold.
2. Verify one successor is created and linked in both directions.
3. Verify pending/in-progress/completed todo states and the active pointer are identical after resume.
4. Verify a crash between checkpoint creation and successor activation replays exactly once.
5. Verify child task and monitor references are restored without duplicate execution.
6. 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.

Contributor guide

Open the contributing guide

Research direction

Start by locating the existing bounded manual checkpoint and replay flow, then trace parent-session lifecycle and context-boundary handling. Add acceptance coverage for threshold rollover, bidirectional linkage, state preservation, crash recovery, child-reference restoration, and automatic continuation; done means each scenario passes without duplicate work.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
backend
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.