Summary
V2 sessions that were actively executing should automatically continue after the shared server restarts, instead of requiring the user to manually prompt them again or leaving stale in-progress state in the TUI.
Desired Behavior
On server startup:
- Identify sessions whose execution was active when the previous process stopped.
- Reconcile the interrupted step and any in-flight tool parts to durable terminal state.
- Resume the agent loop from persisted session state.
- Notify connected clients so the TUI converges without a reload.
The recovery path must not blindly re-execute an in-flight side-effecting tool. A tool whose completion cannot be proven should be recorded as interrupted; the resumed model turn can then inspect state and decide how to continue.
Acceptance Criteria
- An active V2 session automatically resumes after a normal daemon restart, upgrade restart, or unexpected process exit.
- Persisted running/pending tool parts are settled before continuation; no stale spinners remain.
- Recovery does not automatically replay an ambiguous side-effecting tool call.
- Exactly one process owns the resumed execution, including when multiple clients reconnect concurrently.
- Connected and later-opening clients converge on the resumed canonical session state.
- Recovery is idempotent across repeated crashes/restarts.
- Tests cover restart during model streaming, restart during a read-only tool, restart during a side-effecting tool, and repeated restart while recovering.
Related Work
This issue adds the continuation policy after durable interruption reconciliation; it does not replace those issues.
Source
Summary
V2 sessions that were actively executing should automatically continue after the shared server restarts, instead of requiring the user to manually prompt them again or leaving stale in-progress state in the TUI.
Desired Behavior
On server startup:
The recovery path must not blindly re-execute an in-flight side-effecting tool. A tool whose completion cannot be proven should be recorded as interrupted; the resumed model turn can then inspect state and decide how to continue.
Acceptance Criteria
Related Work
This issue adds the continuation policy after durable interruption reconciliation; it does not replace those issues.
Source