fix(core): release a foreground claim when the prompt is interrupted

This commit is contained in:
Kit Langton
2026-11-04 21:05:06 -08:00
Unverified
parent f429081c10
commit d6909801f7
+2 -2
View File
@@ -247,8 +247,8 @@ export const Plugin = {
Effect.mapError(
(error) => new ToolFailure({ message: `Failed to prompt subagent: ${child.id}`, error }),
),
// A prompt that never reached the child leaves the original launch owing its report.
Effect.tapError(() => (claimed === undefined ? Effect.void : subagents.release(recovery, claimed))),
// A prompt that failed or was interrupted leaves the original launch owing its report.
Effect.onError(() => (claimed === undefined ? Effect.void : subagents.release(recovery, claimed))),
)
const started = yield* subagents.start({ recovery, notify, claimed })