feat(subagent): deliver continuable child settlement to parents
A continuable child that stopped without reporting — an error, a token ceiling, cancellation, teardown — left its parent nothing to act on. The continuation manager now delivers an unconditional settlement notice to the durable direct parent before releasing ownership, folding consumed work (foldConsumedWork supersedes findLastMessageTurnEnd) so a claimed-but-unrun prompt reads as aborted rather than completed, waking an idle parent, steering a busy one, and never waking a closing tree.
This commit is contained in:
@@ -549,6 +549,9 @@ describe('dsh-tool-subagent-report result independence', () => {
|
||||
expect(ctx.agents.get(started.childId) === undefined).toBe(true)
|
||||
}, { timeout: 5_000 })
|
||||
|
||||
// The parent does learn the child settled — that account is the
|
||||
// continuation service's, carried under its own `subagent-settled` source.
|
||||
// Nothing turns the child's final answer into a report it did not send.
|
||||
expect(reports(parent)).toEqual([])
|
||||
expect(userTexts((await ctx.sessionPersistence.load(started.childId)).events)).toEqual(['child task'])
|
||||
expect(ctx.get('tasks')).toBeUndefined()
|
||||
|
||||
Reference in New Issue
Block a user