Back to Signal Feed
CodeTracked since May 19, 2026

Stop tool-call batch execution on abort in agent run loop

This change fixes tool-call handling so that when `ctx.abort()` is triggered, the agent execution loop checks `signal?.aborted` during prep/execution, exits early, returns aborted tool results, and halts the run after the current turn while still finalizing through `afterToolCall`.

ctx.abortsignal?.abortedagent tool-call loopafterToolCall

What Happened

  • This change fixes tool-call handling so that when `ctx.abort()` is triggered, the agent execution loop checks `signal?.aborted` during prep/execution, exits early, returns aborted tool results, and halts the run after the current turn while still finalizing through `afterToolCall`.
  • This change fixes tool-call handling so that when `ctx.abort()` is triggered, the agent execution loop checks `signal?.aborted` during prep/execution, exits early, returns aborted tool results, and halts the run after the current turn while still finalizing through `afterToolCall`.
  • 1 evidence item attached for review.

What is Different

Before

Scattered source updates, isolated context, and manual follow-up across multiple feeds.

Now

Adds an explicit abort guard in the tool-call execution path that breaks processing as soon as abort state is observed, returns explicit aborted tool outputs, and preserves post-tool-call finalization behavior.

Why Track This

Why It Matters

When a tool run is aborted, users and operators are less likely to see a workflow continue after cancellation, which reduces confusing partial behavior across a turn and improves operational correctness of tool-driven sessions. Concretely, aborted calls now short-circuit instead of letting other queued calls proceed silently, and cleanup still runs via `afterToolCall`; teams should watch multi-tool-call batches where non-aborted sibling calls remain represented in session export for potential UI or downstream trace interpretation issues.

Impact

When a tool run is aborted, users and operators are less likely to see a workflow continue after cancellation, which reduces confusing partial behavior across a turn and improves operational correctness of tool-driven sessions. Concretely, aborted calls now short-circuit instead of letting other queued calls proceed silently, and cleanup still runs via `afterToolCall`; teams should watch multi-tool-call batches where non-aborted sibling calls remain represented in session export for potential UI or downstream trace interpretation issues.

What To Watch Next

  • Watch whether ctx.abort becomes a repeated pattern.
  • Track follow-up changes around Tool Calling.
  • Compare future signals against this evidence trail.
  • Re-check risk flags: remaining_unexecuted_tool_calls_shown_in_exports, session_ui_misleading_tool_call_state_after_abort.
Open Topic TimelineOpen Technical EventOpen Original Sourceremaining_unexecuted_tool_calls_shown_in_exports / session_ui_misleading_tool_call_state_after_abort / incomplete_visibility_of_abort_scope_in_multi_turn_flows

Supporting Evidence