Skip to content

Conversation

@viniciusdsmello
Copy link
Contributor

@viniciusdsmello viniciusdsmello commented Dec 9, 2025

Pull Request

Summary

Fix Google ADK tracer issue where traces showed "user_query": "Processing..." and "output": null when applications used early generator exit patterns (e.g., break on first final response).

Changes

  • Fix timing bug in google_adk_tracer.py: Update step data immediately during generator iteration instead of after loop completion
  • Add fallback logic: Preserve existing behavior for generators that complete naturally
  • Maintain backward compatibility: Both early-exit and full-consumption patterns now work correctly

Modified Files:

  • src/openlayer/lib/integrations/google_adk_tracer.py (lines 608-649)

Context

User reports of incomplete traces when using common async generator patterns:
async for event in agent.run_async(...):
if event.is_final_response():
response = event.content.parts[0].text
break # ← This broke tracingRoot cause: Step updates happened after async for loop, but break prevented loop completion, so updates never occurred.

Testing

  • Unit tests:
  • Manual testing: Verified with multi-agent customer support system in fastapi-agui-example/
  • Trace verification: Confirmed correct data appears in Openlayer dashboard
  • Backward compatibility: Original usage patterns still work

@viniciusdsmello viniciusdsmello force-pushed the vini/open-8223-bug-google-adk-integration-is-not-always-capturing-models branch from eff0de8 to 96e8cc8 Compare December 9, 2025 21:17
@viniciusdsmello viniciusdsmello self-assigned this Dec 9, 2025
"metadata": {},
"outputs": [],
"outputs": [
{
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you clean the outputs of all cells of the notebook?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done!

Copy link
Contributor

@gustavocidornelas gustavocidornelas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm! just need to clean the output of all cells of the Jupyter notebook. Once done, we can merge

…nnecessary warnings and streamline execution
@gustavocidornelas gustavocidornelas merged commit 9b926ac into main Dec 10, 2025
5 checks passed
@gustavocidornelas gustavocidornelas deleted the vini/open-8223-bug-google-adk-integration-is-not-always-capturing-models branch December 10, 2025 12:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants