#7044: feat: Add local model tool calling support
extensions: memory-lancedb
agents
Cluster:
Error Handling in Agent Tools
## Summary
This PR adds support for local inference models (sglang/vLLM) to use tool calling by allowing them to declare supported API parameters.
## Changes
- Added `supportedParameters` field to model compatibility configuration
- Added `modelSupportsTools()` function for tool capability detection
- Added tool support check in agent runner before tool creation
- Updated schema and types to support local model parameter declarations
## Testing
- Verified with Qwen3-Coder-30B-A3B-Instruct-FP8 model
- Tested with sglang server using `--tool-call-parser qwen3_coder`
- Confirmed tools are properly created and executed
## Usage
Local models can now declare tool support in configuration:
```json
{
"compat": {
"supportedParameters": ["tools", "tool_choice"]
}
}
<!-- greptile_comment -->
<h2>Greptile Overview</h2>
<h3>Greptile Summary</h3>
This PR introduces a `supportedParameters` declaration on model compat config and adds a `modelSupportsTools()` helper used by the embedded runner to skip tool creation for models that don’t advertise `tools` support.
While the core idea is clear, the diff also includes several changes that look accidental/unrelated to the stated goal (a non-TS `src/agents/attempt.test.ts` file, major schema strictness changes for model definitions, and removal of the `edge` TTS provider/schema). Additionally, the runner now contains multiple `/tmp` debug file writes which add side effects and can fail/unhandled-reject in some environments.
<h3>Confidence Score: 1/5</h3>
- Not safe to merge as-is due to likely accidental breaking changes and a malformed test file.
- The PR contains a non-TypeScript test file that will fail CI, plus schema changes that make previously-optional config required and remove the `edge` TTS provider despite existing references. The tool-support gating itself looks plausible, but the unrelated breakages and debug side effects significantly increase merge risk.
- src/agents/attempt.test.ts, src/config/zod-schema.core.ts, src/agents/pi-embedded-runner/run/attempt.ts
<!-- 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
#10975: fix: add missing clientTools parameter to runEmbeddedAttempt call
by xamdel · 2026-02-07
78.1%
#16098: fix: omit tools param for models without tool support, surface erro...
by claw-sylphx · 2026-02-14
77.0%
#9822: fix: allow local/custom model providers for sub-agent inference
by stammtobias91 · 2026-02-05
76.6%
#6683: feat(config): add supportsStrictMode compat option for model defini...
by long-pham · 2026-02-01
76.4%
#9339: fix: enhance OpenAI compatibility for tool calling
by 0xrushi · 2026-02-05
75.9%
#4837: fix: strip tools for Venice models without function calling support
by jonisjongithub · 2026-01-30
75.9%
#9511: feat: add tool error fallback toggle
by bolismauro · 2026-02-05
75.8%
#12642: feat(tools): typed tool schemas for xAI/Grok compatibility
by 2nd-ren · 2026-02-09
75.1%
#9583: fix(models): allow models in agents.defaults.models even if not in ...
by hotzen100 · 2026-02-05
75.0%
#13376: fix: pass model directly to agent for sub-agent runs
by jrbobbyhansen-pixel · 2026-02-10
74.2%