Skip to content

fix: Don’t remove all events between last function response and function event that triggered it #2214

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

alimosaed
Copy link

What is the problem?

When long-running tools are mixed with normal tools, we get a situation where there are multiple tool responses in the event list for the same initial tool call event (multiple tool calls in one event, but individual events for each call following). There seems to be a filter rule in the ADK that expects there to be just one response for each call and it will find the last response for a call and remove all events in between. This makes no sense since shortly after, there is code to consolidate the multiple tool responses into a single event with all the responses. The path here is to just not call the function that removes some of the tool responses.

How did you accomplish this problem?
We removed the _rearrange_events_for_latest_function_response call from the _get_contents method to stop filtering interval responses from tool calls.

Copy link

google-cla bot commented Jul 28, 2025

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.

@alimosaed alimosaed changed the title Bug: Don’t remove all events between last function response and function event that triggered it fix: Don’t remove all events between last function response and function event that triggered it Jul 28, 2025
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.

1 participant