mirror of
https://github.com/anomalyco/opencode.git
synced 2026-11-19 00:03:13 +03:00
fix(core): release a foreground claim when the prompt is interrupted
This commit is contained in:
@@ -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 })
|
||||
|
||||
Reference in New Issue
Block a user