fix(subagent): report interrupted execution cleanup failures once

This commit is contained in:
Dudu-0223 committed 2026-09-21 11:12:33 +08:00
1 parent 5ca7f533e1
commit 89e2c7e0ea
2 files changed
+4 -1

No files matched your search

@@ -369,7 +369,8 @@ export class ContinuableActivationRegistry {
activation.execution.cancel(kind, true)
} else {
activation.execution.controller.abort({ kind })
void this.dispose(activation).catch((error: unknown) => { this.reportTeardownFailure(activation, error) })
// The settlement observer reports teardown failures.
void this.dispose(activation).catch(() => undefined)
}
}
@@ -221,6 +221,7 @@ describe('external subagent activations', () => {
return { ...backend.run, dispose }
})
const activation = await fixture.start()
const warning = vi.spyOn(fixture.ctx.logger, 'warn')
const authority = kind === 'user'
? { kind, parentSessionId: fixture.parent.id }
: { kind, agent: fixture.parent }
@@ -238,6 +239,7 @@ describe('external subagent activations', () => {
const rejected = expect(disposal).rejects.toThrow('interrupt cleanup failed')
backend.cleanup.reject(new Error('interrupt cleanup failed'))
await rejected
await vi.waitFor(() => { expect(warning).toHaveBeenCalledTimes(1) })
} else {
backend.cleanup.resolve(undefined)
await disposal