ADK 2.0 ignores before_run callback returning a value for workflows. In this case the execution should stop and no further llm calls should be executed.
Problem is in runner.py / _run_node_async where
await ic.plugin_manager.run_before_run_callback(invocation_context=ic)
swallows returned value and never checks if execution should continue
Steps to Reproduce:
Use Workflow as root_agent
Implement plugin and override before_run_callback
Expected Behavior:
Execution should stop if before_run_callback returns a value as described here:
"Returning a value to halt execution of the runner and ends the runner with that event"
Environment Details:
- ADK Library Version (pip show google-adk): 2.2
- Desktop OS: Linux
- Python Version (python -V): 3.12
Model Information:
- Are you using LiteLLM: No
How often has this issue occurred?:
ADK 2.0 ignores before_run callback returning a value for workflows. In this case the execution should stop and no further llm calls should be executed.
Problem is in runner.py / _run_node_async where
swallows returned value and never checks if execution should continue
Steps to Reproduce:
Use Workflow as root_agent
Implement plugin and override before_run_callback
Expected Behavior:
Execution should stop if before_run_callback returns a value as described here:
"Returning a value to halt execution of the runner and ends the runner with that event"
Environment Details:
Model Information:
How often has this issue occurred?: