8000 Session can't continue after tool error or stopping stream · Issue #1484 · google/adk-python · GitHub
[go: up one dir, main page]

Skip to content
Session can't continue after tool error or stopping stream #1484
Open
@hung12ct

Description

@hung12ct

Describe the bug
Currently if I stop the stream mid-response, or if a tool throws an error before finishing, the session becomes unusable. Any new message returns:
litellm.BadRequestError: OpenAIException - An assistant message with 'tool_calls' must be followed by tool messages responding to each 'tool_call_id'.
It seems the session expects unfinished tool calls to be completed, even after failure or interruption. Would be great if the session could recover or reset tool_call state in such cases.

To Reproduce
Steps to reproduce the behavior:

  1. Trigger a tool in the agent.
  2. Either: Raise an exception inside the tool, or Sstop the stream midway during the tool response.
  3. Send a new user message.
  4. Error occurs: tool_call_id not responded.
    Expected behavior
    I expect to be able to stop the stream at any point without breaking the session.
    Also, if a tool throws an exception, the session should remain usable => it shouldn’t get stuck or throw tool_call_id errors on the next user message.

Screenshots

Image

Desktop (please complete the following information):

  • OS: Linux Ubuntu
  • Python version(python -V): 3.12
  • ADK version(pip show google-adk): 1.3.0
    How can i fix this?

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

    0