Skip to content

Conversation

@cristianleoo
Copy link

When using Gemini 2.0/3.0 models with thinking/reasoning enabled, the model may emit a reasoning block followed immediately by a tool call in the same stream chunk or sequence.

The current implementation initiates the reasoning block but fails to close it before processing the tool call, leading to state errors (nested blocks).

This patch ensures any open content block (like reasoning) is closed before a tool call start event is emitted.

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant