feat: add tool progress callback hook#5986
Conversation
|
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
|
Response from ADK Triaging Agent Hello @ai-hustle-bro, thank you for submitting this pull request! We appreciate your work on adding the tool progress callback hook. However, it seems a couple of items from our contribution guidelines are still pending:
These details will help our reviewers understand and verify your changes more quickly. Thank you! |
|
I added a manual smoke check for the runner hook path requested by the triage bot. This avoids an external model call, but it exercises Runner-created InvocationContext plus FunctionTool execution with a declared progress_callback parameter. Command run from the PR branch: `powershell Inline Python passed to: uv run python -` Smoke script: `python async def main(): asyncio.run(main()) Output:
Other validation already run on this branch: ` ext 34 passed, warnings onlyuv run --with pyink pyink --check src/google/adk/agents/invocation_context.py src/google/adk/tools/function_tool.py src/google/adk/runners.py tests/unittests/tools/test_function_tool.py 4 files unchangedgit diff --check no output` The remaining blocker I can see is the Google CLA check. |
|
Hi @ai-hustle-bro , Thank you for your contribution! It appears you haven't yet signed the Contributor License Agreement (CLA). Please visit https://cla.developers.google.com/ to complete the signing process. Once the CLA is signed, we'll be able to proceed with the review of your PR. Thank you! |
Link to Issue or Description of Change
1. Link to an existing issue (if applicable):
Problem:
Long-running tools can currently only report intermediate status through model-facing results/yields. That is useful for context-relevant updates, but UI-only progress messages still consume model context.
Solution:
This PR adds an opt-in
progress_callbackinjection path forFunctionTool:progress_callbackfrom model-facing function declarationsrun_async()and live_call_live()when a tool declares the parametertool_progress_handleronInvocationContextRunner.on_tool_progressas the app-level registration pointTesting Plan
Unit Tests:
Passed locally:
Additional local checks:
Manual End-to-End (E2E) Tests:
Not run yet. I kept the first pass to isolated unit coverage plus two existing live streaming regressions. I can add an example runner snippet or run a manual live-mode check if maintainers prefer that evidence before review.
Checklist
Additional context
The callback intentionally does not create model-facing content. Tool authors can still
yieldor return context-relevant updates when the model should reason about them, and useprogress_callback(...)only for app/UI progress.