Repository navigation
Let callers set how many tool rounds a response takes - #331
Merged
Merged
Conversation
Collaborator
|
Thanks, @akbashev. Now that #343 is in, I'd like to settle what happens at the cap before we make it configurable. Right now hitting it throws When you rebase, a few things to pick up:
|
GenerationOptions gains maximumToolRounds, 8 by default as before, so a caller that runs longer agent turns can allow more rounds of tool calls without changing what anyone else gets.
A response past its tool-round limit threw a decoding failure, and the rounds that had run were lost. It now throws ToolRoundLimitExceeded, a separate error type rather than a new GenerationError case, which carries the rounds that ran, each tool call followed by its output, so a caller can add them to the transcript and continue. The round past the limit doesn't run and isn't included. Every provider stops the same way, llama.cpp included, through ToolRoundLimit. maximumToolRounds must be at least 1, as below that every response that calls a tool would fail at once; coded options carry it and refuse a value below 1 as a decoding error. SystemLanguageModel ignores it, as its documentation now says.
Contributor
Author
|
Thanks, @mattt. I agree with a separate error type. It's in now, rebased on
|
akbashev
force-pushed
the
fix/maximum-tool-rounds
branch
from
October 17, 2026 19:24
f03d847 to
59d106e
Compare
This was referenced Oct 17, 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.
GenerationOptionsgainsmaximumToolRounds, 8 by default as before. A caller that runs longer agent turns can then allow more rounds of tool calls without changing what anyone else gets.Every provider honours it:
ToolRoundLimit;