fix: increase maxTokens for tool probe to support reasoning models#7521
Merged
vincentkoc merged 3 commits intoopenclaw:mainfrom Mar 7, 2026
Merged
fix: increase maxTokens for tool probe to support reasoning models#7521vincentkoc merged 3 commits intoopenclaw:mainfrom
vincentkoc merged 3 commits intoopenclaw:mainfrom
Conversation
bfc1ccb to
f92900f
Compare
This comment was marked as spam.
This comment was marked as spam.
joshavant
pushed a commit
that referenced
this pull request
Mar 7, 2026
vincentkoc
pushed a commit
to BryanTegomoh/openclaw-fork
that referenced
this pull request
Mar 8, 2026
Saitop
pushed a commit
to NomiciAI/openclaw
that referenced
this pull request
Mar 8, 2026
jenawant
pushed a commit
to jenawant/openclaw
that referenced
this pull request
Mar 10, 2026
V-Gutierrez
pushed a commit
to V-Gutierrez/openclaw-vendor
that referenced
this pull request
Mar 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.
Problem
The tool capability probe uses
maxTokens: 32, which is insufficient for reasoning models like StepFun's step-3.5-flash. These models output reasoning/thinking tokens before making tool calls, and with only 32 tokens, the model exhausts its budget during reasoning and never produces the actual tool call.This causes false negatives where tool-capable reasoning models are incorrectly marked as not supporting tools.
Solution
Increase
maxTokensfrom 32 to 256 in theprobeToolfunction. This provides enough headroom for reasoning models to complete their thinking and output the tool call.Testing
Verified against
stepfun/step-3.5-flash:freevia OpenRouter API:maxTokens: 32: Model outputs ~39 reasoning tokens, hits length limit, no tool call returnedmaxTokens: 256: Model completes reasoning (~51 tokens) and successfully returns tool call withfinish_reason: "tool_calls"Models affected
Greptile Overview
Greptile Summary
This PR updates the OpenRouter model capability scanner’s tool-support probe by increasing the
maxTokensbudget inprobeToolfrom 32 to 256 (src/agents/model-scan.ts). This better accommodates “reasoning” models that emit substantial thinking tokens before producing a required tool call, reducing false negatives when determining tool capability.Confidence Score: 5/5
(2/5) Greptile learns from your feedback when you react with thumbs up/down!