Skip to content

[RunInference] Fix non-text part crash and stateless session leak in ADKAgentModelHandler - #41905

Open
arijeetmukherjee3108-droid wants to merge 1 commit into
apache:masterfrom
arijeetmukherjee3108-droid:fix-adk-handler-bugs
Open

arijeetmukherjee3108-droid wants to merge 1 commit into
apache:masterfrom
arijeetmukherjee3108-droid:fix-adk-handler-bugs

Conversation

@arijeetmukherjee3108-droid

Copy link
Copy Markdown
Contributor

Fixes #41904

  • Skip non-text parts (p.text is None) when joining the final response text in _invoke_agent() so responses with non-text parts don't crash with a TypeError. Still raises ValueError if no text parts are returned.
  • Delete auto-generated stateless sessions in a finally block once _invoke_agent() finishes (both on success and on error), while keeping user-provided session_id sessions intact.

Added unit tests in agent_development_kit_test.py covering non-text response parts and stateless session cleanup.

@github-actions

github-actions Bot commented Dec 3, 2026

Copy link
Copy Markdown
Contributor

Assigning reviewers:

R: @Abacn added as fallback since no labels match configuration
Backup reviewer: chamikaramj (if the main reviewer is unresponsive, you can escalate to them by tagging their username)

Note: If you would like to opt out of this review, comment assign to next reviewer.

Available commands:

  • stop reviewer notifications - opt out of the automated review tooling
  • remind me after tests pass - tag the comment author after tests pass
  • waiting on author - shift the attention set back to the author (any comment or push by the author will return the attention set to the reviewers)

The PR bot will only process comments in the main thread (not review comments).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: ADKAgentModelHandler crashes on non-text parts and doesn't delete temporary sessions

1 participant