#4837: fix: strip tools for Venice models without function calling support
agents
Cluster:
Venice Model Updates
## Problem
Venice AI models that don't support function calling (`hermes-3-llama-3.1-405b`, `venice-uncensored`, `deepseek-v3.2`) receive tools from OpenClaw unconditionally, causing Venice to reject the request with validation errors and return empty responses.
Venice's `/v1/models` endpoint correctly reports `supportsFunctionCalling: false` for these 3 models.
## Solution
1. **`src/config/types.models.ts`**: Added optional `supportsFunctionCalling?: boolean` to `ModelDefinitionConfig`
2. **`src/agents/venice-models.ts`**:
- Marked 3 models with `supportsFunctionCalling: false` in the static catalog
- Updated `buildVeniceModelDefinition()` to propagate the field
- Updated `discoverVeniceModels()` to read `supportsFunctionCalling` from the Venice API for newly discovered models
- Exported `veniceModelSupportsFunctionCalling()` helper for runtime lookups
3. **`src/agents/pi-embedded-runner/run/attempt.ts`**: When provider is `venice`, checks function calling support before creating tools — strips tools for unsupported models (same behavior as `disableTools`)
## Notes
- The pi-ai `Model` interface doesn't support custom fields, so the runtime check uses a direct catalog lookup rather than threading through the model object
- Models default to supporting function calling; only explicitly marked models are affected
- Build passes cleanly (`pnpm build`)
Co-authored-by: jonisjongithub <jonisjongithub@users.noreply.github.com>
Co-authored-by: Clawdbot <bot@clawd.bot>
<!-- greptile_comment -->
<h2>Greptile Overview</h2>
<h3>Greptile Summary</h3>
This PR adds a `supportsFunctionCalling?: boolean` capability flag to `ModelDefinitionConfig`, annotates known Venice models that lack function calling support, propagates the flag through Venice model discovery, and uses a new `veniceModelSupportsFunctionCalling()` helper to strip tools at runtime for Venice models that can’t handle tool schemas. This prevents Venice request validation errors and empty responses caused by sending tools unconditionally.
<h3>Confidence Score: 4/5</h3>
- This PR is generally safe to merge and addresses a real provider capability mismatch, with one potential provider-id mismatch to verify.
- Changes are localized (Venice model catalog/discovery and tool creation gating) and align with Venice’s reported capabilities. Main remaining risk is whether `params.provider` vs `params.model.provider` can diverge, which could cause tools to be stripped (or not) unexpectedly.
- src/agents/pi-embedded-runner/run/attempt.ts (provider check logic)
<!-- greptile_other_comments_section -->
<!-- /greptile_comment -->
Most Similar PRs
#12964: fix(#20156): Venice - add missing models and set a new model default
by sabrinaaquino · 2026-02-10
79.4%
#7044: feat: Add local model tool calling support
by jokelord · 2026-02-02
75.9%
#9990: refactor(agents): replace console.warn with SubsystemLogger in veni...
by dinakars777 · 2026-02-06
75.5%
#20175: fix: update Venice provider model catalog with latest models
by MisterGuy420 · 2026-02-18
75.0%
#14508: fix(models): allow forward-compat models in allowlist check
by jonisjongithub · 2026-02-12
74.9%
#15991: feat: add Novita AI provider support with dynamic model discovery
by Alex-wuhu · 2026-02-14
74.5%
#10975: fix: add missing clientTools parameter to runEmbeddedAttempt call
by xamdel · 2026-02-07
73.5%
#6673: fix: preserve allowAny flag in createModelSelectionState for custom...
by tenor0 · 2026-02-01
73.3%
#16098: fix: omit tools param for models without tool support, surface erro...
by claw-sylphx · 2026-02-14
73.2%
#9583: fix(models): allow models in agents.defaults.models even if not in ...
by hotzen100 · 2026-02-05
73.2%