Files
paseo/docs
Mohamed Boudra 170101f146 fix(server): keep notifying the caller when a child ends its turn while still working
A finish subscription ended at the child's first turn end. A Claude child that
ends its turn with a background shell, Monitor, background subagent, or its own
delegated agents still running then started its real follow-up turn on its own,
and nobody was subscribed to report it (or a plan/permission request in it).

The subscription now separates "the turn ended" from "the child has stopped".
At a turn end it asks the child's host for pending work: a running turn, queued
messages, a provider wake-up (new AgentSession.hasPendingWakeup probe), or the
child's own outstanding finish subscriptions as a caller. With pending work the
caller gets one "ended its turn but is still working" notice and the
subscription follows the child (followingSince is persisted before the notice,
so restarts neither repeat it nor lose the follow). It reports finished once
nothing is pending, and gives up after 24 hours.

Heartbeats, recurring crons, and other daemon background items are not pending
work: they never settle and would hold a subscription forever. Claude's probe
counts a task notification whose turn has not started yet, because the SDK
empties the background roster before the wake-up turn's init arrives.
Remote children and providers without the probe keep reporting their first turn
end as finished.
2026-11-26 02:10:58 +01:00
..