Constrain Flash automatic tool calls and preserve visible answers - #47
Draft
TracSystems wants to merge 133 commits into
Draft
TracSystems wants to merge 133 commits into
TracSystems wants to merge 133 commits into
Conversation
This branch has not been deployed
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.
Flash could emit
finish_reason=tool_callswith incomplete JSON arguments during an automatic tool call. Core correctly rejected the call, but the user task failed. The managed Flash runtime now constrains automatic tool calls so their XML/JSON structure is complete before the native response is returned.OpenAI-compatible providers also preserve visible answers when thinking is enabled but no separate reasoning block is returned. An optional, bounded diagnostic records only response shape and validation outcomes to distinguish native output from envelope failures; it records no prompts or tool arguments.
The Flash-only canary passed public API calls with automatic tool choice across thinking on/off and streaming/non-streaming, a longer streamed tool call, and ordinary chat. All tool arguments were valid JSON. Comparable plain streamed generation measured 49.3 and 52.7 tokens/s after the change, within the expected operating range; measurements vary with load. Targeted provider tests and workspace metadata checks passed. No contract, catalog, or other model runtime changes are included. Full-fleet rollout is outside this PR's deployment scope.