Repository navigation
feat: Add execution plugin hooks around AgentExecutor - #839
Merged
Merged
Conversation
🧪 Code Coverage
Generated by coverage-comment.yml |
JakubWorek
reviewed
Nov 19, 2026
JakubWorek
approved these changes
Nov 20, 2026
This was referenced Nov 25, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Runs the execution hooks from
@a2a-js/sdk/plugins(#826) around everyAgentExecutor.executecall made byDefaultRequestHandler. They use the samepluginsoption as the server hooks (#835).Behavior
beforeExecutionruns before the agent. If it throws, the agent does not run, plugins that already ran getafterExecutionwith the error, and the handler's usual failure path publishes a FAILED task.aroundExecution. The agent runs detached from the request, so this is where a plugin can scope it, for example to make the agent's outbound calls children of an OTel span.afterExecutionruns when the agent returns or throws, with the error if there is one. The error is rethrown, so the handler's existing failure handling is unchanged.onExecutionEventruns for each event published on the task's bus while the agent runs. The agent gets the original bus. Events the handler publishes after the agent throws (the synthetic FAILED task and status) are not reported.cancelTaskruns without hooks.