Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion packages/opencode/src/tool/task.ts
Original file line number Diff line number Diff line change
Expand Up @@ -386,7 +386,10 @@ export const TaskTool = Tool.define(
}),
(_, exit) =>
Effect.gen(function* () {
if (Exit.hasInterrupts(exit))
// Cancel on any abnormal exit (interrupt, fail, or die). Limiting cleanup to
// interrupts left subagent sessions orphaned when Effect.orDie converted tool
// errors into defects, so the parent continued while the child kept running.
if (Exit.isFailure(exit))
yield* Effect.all([cancel, background.cancel(nextSession.id)], { discard: true })
}).pipe(
Effect.ensuring(
Expand Down
Loading