Repository navigation
Recover empty and text-only tool responses in the LLM compatibility proxy - #120
Open
JeffPengCoder wants to merge 2 commits into
Open
JeffPengCoder wants to merge 2 commits into
JeffPengCoder wants to merge 2 commits into
Conversation
Signed-off-by: Jeff Peng <jepeng@nvidia.com>
JeffPengCoder
requested review from
RohanAdwankar and
kgengedullay
as code owners
November 19, 2026 06:08
Signed-off-by: Jeff Peng <jepeng@nvidia.com>
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.
When a tool-capable model returns only whitespace or prints
<run_kubectl args=[... ]}as ordinary text, the runtime receives no tool call. In a native messaging channel the run can finish without a visible reply, or show a command that never executed. This adds an opt-in recovery guard to the existing LLM compatibility proxy.Set
llm.requestCompatibility.toolCallTextRecovery.enabled=trueto buffer single-choice, automatic-tool completions. If a completed response has no structured calls and is empty or contains recognizable invocation markup for a registered tool, the proxy retries once with the original conversation and tool definitions plus a corrective system instruction. It never converts the text into executable arguments or executes tools. Existing native calls pass through unchanged; runtime validation and authorization still apply. A second invalid response fails explicitly.The setting defaults to false. Enabling it delays eligible streaming responses until generation completes and may consume one additional model request. Buffering is capped at 16 MiB, with a 180-second deadline across both requests. Named/disabled tool choice, multiple choices, ordinary prose, quoted/fenced examples and explicit silent-response markers retain their existing behavior. Detection covers recognizable invocation markup, not every malformed output or the factual quality of an answer.
Validation:
git diff --checkpassed. The unchanged upstream BCM server suite passes all 24 tests on Linux; its process-group termination test hits macOSPermissionError, independently of this change.The source branch is based on
main. Changes are limited to the compatibility guard, its chart wiring, tests and documentation; existing channel configuration is unchanged. The commit is DCO signed off.