← Back to PRs

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

by jakobdylanc open 2026-02-02 22:49 View on GitHub →
agents
## 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_comment --> <h2>Greptile Overview</h2> <h3>Greptile Summary</h3> 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. <h3>Confidence Score: 5/5</h3> - 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 <!-- greptile_other_comments_section --> <sub>(2/5) Greptile learns from your feedback when you react with thumbs up/down!</sub> <!-- /greptile_comment -->

Most Similar PRs