-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Labels
core[Component] This issue is related to the core interface and implementation[Component] This issue is related to the core interface and implementation
Description
Description
The plugin framework provides hooks for various lifecycle events (before/after agent, tool, model callbacks, etc.), but there is no mechanism to notify plugins when session state changes occur via event.actions.state_delta.
The BigQueryAgentAnalyticsPlugin already implements an on_state_change_callback() method, demonstrating real demand for this hook, but the framework never invokes it because:
BasePluginhas no defaulton_state_change_callbackmethodPluginManagerhas no dispatcher for it- The runner never detects state deltas and triggers the callback
Expected Behavior
When an event with a non-empty state_delta is yielded from the runner, all registered plugins should have their on_state_change_callback invoked with the state delta (as a copy, to prevent mutation).
Proposed Solution
- Add
on_state_change_callbacktoBasePluginas a default no-op method - Add
"on_state_change_callback"toPluginCallbackNameand arun_on_state_change_callbackdispatcher toPluginManager - In
Runner._exec_with_plugin, after yielding the final event, check forstate_deltaand invoke the callback
The callback should be observational (return value ignored) and receive a copy of the state delta to prevent plugins from mutating event state.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
core[Component] This issue is related to the core interface and implementation[Component] This issue is related to the core interface and implementation