fix: multiple control flow tools same llm call#673
Merged
cotovanu-cristian merged 1 commit intomainfrom Mar 9, 2026
Merged
Conversation
365a4f5 to
9d8a4e4
Compare
9d8a4e4 to
d4116d6
Compare
d4116d6 to
e4fb2c3
Compare
cristian-groza
approved these changes
Mar 9, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes handling of multiple control flow tool calls (end_execution, raise_error) returned in a single LLM response.
The previous filter in _filter_control_flow_tool_calls was designed to strip control flow tools from mixed responses (e.g. [regular_tool, end_execution]). When the LLM returned only control flow tools (e.g. [end_execution, raise_error]), all of them got filtered out, leaving an empty
tool call list and causing a routing error — "No control flow tool call found" — in the terminate node.
Changes
_filter_control_flow_tool_calls (llm_node.py)
When the LLM response contains only control flow tools: