Repository navigation
Conversation
…for the call tool_choice required and named functions now set a thinking budget of max_tokens minus max(256, max_tokens/4), capped by any requested budget, so a think block that never ends cannot use the whole reply. Requests without tools and tool_choice auto are unchanged.
The fixture called tool_think.apply itself, so it still passed with the call in chat.prepare removed. It now turns thinking on, gives the fake server its close markers and the thinking_budget capability, and builds the request with chat.prepare, so the wiring is what the lane and reply assertions check. Without the call the named case fails (expected 44, found 0).
… off by default Closing the think block early changes the reply of a required or named call whose thinking would have ended between the cap and max_tokens, including calls that already succeed. The close is now opt-in through --tool-think-close, as --loop-guard-stop is; without it every request is prepared as before. The thinking tests move to tool_think_test.zig. With the flag, a think block that never ends closes at the cap and the call follows. Without it, a call whose thinking ends past the cap (at 200 of 300 tokens) keeps main's request and emits the same tokens. The docs, run guide and changelog name the flag.
Owner
Author
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.
CI for a landing train: #4144 #4157 stacked on main in that order. Nothing merges from this PR: each PR above lands on its own once this tip is green, and this PR is then closed.