fix(core): resume directly driven child sessions after restart (#63415)

This commit is contained in:
James Long
2026-11-12 13:23:00 -06:00
committed by GitHub
Unverified
parent 8c809fb1f8
commit a1aa513f78
5 changed files with 130 additions and 33 deletions
+2 -2
View File
@@ -65,7 +65,7 @@ The public interrupt operation verifies that the durable Session exists. An unkn
`sessions.active()` snapshots busy periods currently owned by this process. Durable execution events and claims are historical and recovery records, not proof that this process is still live.
Execution commits a write-ahead claim when a process-local busy period starts. Success, failure, and user interruption release the claim; shutdown interruption and unclean process death preserve it. On startup, managed Node and fetch runtimes resume claimed top-level Sessions, append a durable continuation instruction, and count recovery attempts. Recovery is bounded per claimed execution but does not guarantee exactly-once provider requests or tool effects.
Execution commits a write-ahead claim when a process-local busy period starts. Success, failure, and user interruption release the claim; shutdown interruption and unclean process death preserve it. On startup, managed Node and fetch runtimes resume claimed Sessions, append a durable continuation instruction, and count recovery attempts. A running subagent Job owns its child's recovery; a directly driven child resumes through its own claim. Recovery is bounded per claimed execution but does not guarantee exactly-once provider requests or tool effects.
## One Step May Have Several Physical Attempts
@@ -113,6 +113,6 @@ There is no separate finite Session-history endpoint. Request/response consumers
## Recovery Boundaries Stay Explicit
An advisory wake is not itself crash recovery. Crash recovery is driven by a write-ahead execution claim that survives without a releasing terminal. Startup recovery resumes claimed top-level Sessions from durable projected history with bounded attempt accounting. It fails stale running tool projections before continuing, but it cannot prove whether an interrupted external operation already took effect and does not guarantee exactly-once provider or tool behavior.
An advisory wake is not itself crash recovery. Crash recovery is driven by a write-ahead execution claim that survives without a releasing terminal. Startup recovery resumes claimed Sessions from durable projected history with bounded attempt accounting. It fails stale running tool projections before continuing, but it cannot prove whether an interrupted external operation already took effect and does not guarantee exactly-once provider or tool behavior.
Event replay ownership is separate from Session execution ownership. Local execution remains process-owned until clustering introduces an explicit placement and fencing protocol.