fix: enable native OpenAI-style tool calling for local model providers#964
Open
octo-patch wants to merge 1 commit intovoideditor:mainfrom
Open
Conversation
fixes voideditor#857) Local providers (Ollama, vLLM, LM Studio, liteLLM, openAICompatible) all use the OpenAI-compatible API which supports native function/tool calling. However, models served via these providers were missing `specialToolFormat: 'openai-style'` in their capability definitions, causing Void to fall back to XML-based tool prompting instead of sending the `tools` parameter in API requests. This meant models like qwen3-coder, llama3.1, devstral, etc. never received tool definitions and could not perform file edits or other agentic actions, resulting in 'No Search/Replace blocks were received!' errors. Fix: add `specialToolFormat: 'openai-style'` to all chat/agent models in `openSourceModelOptions_assumingOAICompat` and `ollamaModelOptions`. Users who need to disable this for a specific model can override via `specialToolFormat` in their model's advanced settings JSON. Co-Authored-By: Octopus <liyuan851277048@icloud.com>
This was referenced Apr 30, 2026
h2balloon
referenced
this pull request
in h2balloon/voidberg
Apr 30, 2026
Cherry-picked from voideditor/void: - #964: add specialToolFormat: 'openai-style' to all OSS/Ollama model entries so local providers send native tool calls instead of falling back to broken XML prompting (fixes apply/edit on qwen-coder, llama3.1+) - #961: ensure MCP tool name prefix starts with a letter to satisfy Gemini FunctionDeclaration.name validation (fixes 400 INVALID_ARGUMENT); also includes position:relative on .interactive-session for DnD overlay Co-Authored-By: octo-patch <noreply@github.com> Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
h2balloon
referenced
this pull request
in h2balloon/voidberg
Apr 30, 2026
26 tests across 4 suites: - specialToolFormat: verifies OSS/Ollama models get openai-style tool calling via both exact Ollama entries and openAICompatible fallback - Gemini routing: verifies 2.5/3.x models route to correct buckets and that removed gemini-3-pro-preview is correctly unrecognized - Ordering edge cases: flash-lite disambiguation, deepseek-r1 vs V3, and a documented known bug in the llama3.1 fallback rule ordering - Overrides: specialToolFormat and contextWindow can be overridden Also discovered Gemini provider has no substring fallback (returns null for unknown models) unlike openAICompatible — captured in tests. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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.
Fixes #857
Problem
Local model providers (Ollama, vLLM, LM Studio, liteLLM, openAICompatible) all expose an OpenAI-compatible API that supports native function/tool calling. However, models served via these providers were missing
specialToolFormat: 'openai-style'in their capability definitions.Without this flag, Void falls back to XML-based tool prompting (embedding tool definitions in the system prompt and parsing XML tags from the model's text output). This approach is unreliable for modern local models that expect to receive tools via the standard
toolsparameter and returntool_callsin structured JSON.As a result, users see errors like
"No Search/Replace blocks were received!"because:toolsparameter is never sent in API requests to local providersThis is consistently reported across multiple models: qwen3-coder, qwen2.5-coder, llama3.x, devstral, gemma, etc. via Ollama, vLLM, LM Studio, and liteLLM.
Solution
Add
specialToolFormat: 'openai-style'to all chat/agent-capable models in:openSourceModelOptions_assumingOAICompat(used as fallback for unrecognized model names)ollamaModelOptions(Ollama-specific recognized models)This enables:
toolsparameter to be sent in API requests to local providerstool_callsresponses to be parsed correctly (already implemented in the streaming handler)Users who need to disable native tool calling for a specific model can override via the
specialToolFormatfield in their model's advanced settings JSON.Testing
The fix is targeted at model capability definitions only and affects no runtime logic. The existing streaming handler already processes
tool_callsfrom OpenAI-compatible responses correctly — the missing piece was sending thetoolsparameter.