Skip to content

fix: increase maxTokens for tool probe to support reasoning models#7521

Merged
vincentkoc merged 3 commits intoopenclaw:mainfrom
jakobdylanc:fix-tool-probe-max-tokens
Mar 7, 2026
Merged

fix: increase maxTokens for tool probe to support reasoning models#7521
vincentkoc merged 3 commits intoopenclaw:mainfrom
jakobdylanc:fix-tool-probe-max-tokens

Conversation

@jakobdylanc
Copy link
Copy Markdown
Contributor

@jakobdylanc jakobdylanc commented Feb 2, 2026

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 maxTokens from 32 to 256 in the probeTool function. This provides enough headroom for reasoning models to complete their thinking and output the tool call.

Testing

Verified against stepfun/step-3.5-flash:free via OpenRouter API:

  • With maxTokens: 32: Model outputs ~39 reasoning tokens, hits length limit, no tool call returned
  • With maxTokens: 256: Model completes reasoning (~51 tokens) and successfully returns tool call with finish_reason: "tool_calls"

Models affected

  • stepfun/step-3.5-flash:free
  • Other reasoning-enabled models that output thinking tokens before tool calls

Greptile Overview

Greptile Summary

This PR updates the OpenRouter model capability scanner’s tool-support probe by increasing the maxTokens budget in probeTool from 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

  • This PR is safe to merge with minimal risk.
  • The change is a single-parameter adjustment (maxTokens 32→256) confined to the tool-capability probe; it aligns with the stated failure mode for reasoning models and does not alter control flow or data structures.
  • No files require special attention

(2/5) Greptile learns from your feedback when you react with thumbs up/down!

@openclaw-barnacle openclaw-barnacle bot added the agents Agent runtime and tooling label Feb 2, 2026
@mudrii

This comment was marked as spam.

@vincentkoc vincentkoc self-assigned this Mar 7, 2026
@vincentkoc vincentkoc merged commit fa69f83 into openclaw:main Mar 7, 2026
5 checks passed
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling size: XS

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants