Skip to content

Spec AbortSignal integration with tool execution - #247

Merged
domfarolino merged 13 commits into
mainfrom
abortable-tools
Aug 19, 2026
Merged

Spec AbortSignal integration with tool execution#247
domfarolino merged 13 commits into
mainfrom
abortable-tools

Conversation

@domfarolino

@domfarolino domfarolino commented Aug 17, 2026

Copy link
Copy Markdown
Collaborator

This PR specifies abortable tools, via AbortSignal integration with executeTool(). Specifically, we introduce a new "local" pending execution map that is only ever mutated on the tool owner/target document's event loop, so it can track pending executions from its side, separately from the "traversable"-global map that's mutated in parallel and matches a canonical "browser process". We introduce the ToolExecuteCallbackOptions dictionary and its sole signal member, which is always passed into the ToolExecuteCallback as its second argument.

This PR also handles various race conditions with tool execution, tool cancellation, and tool promise resolution/rejection, that can all happen across agent clusters. Each race condition is accounted for and documented, sometimes with examples.

Fixes #48.


Preview | Diff

Comment thread index.bs Outdated
Comment thread index.bs Outdated
Comment thread index.bs Outdated
Comment thread index.bs
Comment thread index.bs
Comment thread index.bs Outdated
Comment thread index.bs Outdated
@domfarolino
domfarolino merged commit 83e893a into main Aug 19, 2026
2 checks passed
@domfarolino
domfarolino deleted the abortable-tools branch August 19, 2026 18:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add a callback to inform the site when tool invocation should be aborted

2 participants