Repository navigation
fix(core): invoke plugin beforeAgentCallback and afterAgentCallback - #1137
Open
reginaldalfret wants to merge 1 commit into
Open
reginaldalfret wants to merge 1 commit into
reginaldalfret wants to merge 1 commit into
Conversation
Fixes google#1131 BaseAgent.handleBeforeAgentCallback and BaseAgent.handleAfterAgentCallback previously only checked for canonical callbacks on the agent instance. As a result, if an agent had no instance callbacks configured, it would return undefined immediately without invoking the registered plugins. Furthermore, even with instance callbacks present, PluginManager's runBeforeAgentCallback and runAfterAgentCallback were never invoked. This change runs invocationContext.pluginManager.runBeforeAgentCallback and runAfterAgentCallback in handleBeforeAgentCallback and handleAfterAgentCallback, allowing plugins to inspect, short-circuit, or alter agent execution as specified in BasePlugin. Signed-off-by: reginaldalfret <reginaldalfret@gmail.com>
|
Hi @reginaldalfret, Thanks for your pull request! |
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.
Summary
Fixes #1131.
In BaseAgent.handleBeforeAgentCallback and BaseAgent.handleAfterAgentCallback, execution previously only checked his.canonicalBeforeAgentCallbacks / his.canonicalAfterAgentCallbacks. If an agent had no instance callbacks configured, it would return undefined immediately without invoking registered plugins. Furthermore, even when instance callbacks were present, invocationContext.pluginManager.runBeforeAgentCallback and
unAfterAgentCallback were never invoked.
This PR connects BaseAgent callback handling to PluginManager:
Verification
pm run build completed successfully across all workspaces.
pm run ts:check completed with 0 errors.
pm run format:check confirmed Prettier code style passes.
pm run lint completed with 0 errors.