Describe the bug
The native Ollama provider has three issues that degrade tool-calling behavior and context management:
- Premature context condensing:
parseOllamaModel sets maxTokens to the full contextWindow. Since getModelMaxOutputTokens reserves 20% of the window for output, this causes the context to be condensed far earlier than necessary.
- Tool results sent as user messages:
convertToOllamaMessages always sends tool results with the "user" role, so the model cannot distinguish tool results from actual user messages.
additionalProperties in tool schema: The tool parameter schema includes additionalProperties, which is not part of Ollama's tool schema definition and breaks tool-calling templates on some models.
To Reproduce
Steps to reproduce the behavior:
- Configure a native Ollama model with a large context window.
- Use a tool-calling workflow with the model.
- Observe premature condensing and/or malformed tool-call behavior.
Expected behavior
maxTokens should reflect max output tokens (not the full context window), inheriting the sane default (4096).
- Tool results should use Ollama's native
"tool" role with tool_name when the corresponding tool_use block is known.
additionalProperties should be stripped from tool parameter schemas.
What version of zoo are you running
latest
Additional context
The fix tracks tool_use IDs to tool names so tool results can be sent with the correct role, inherits the default maxTokens, and strips additionalProperties from tool schemas.
Describe the bug
The native Ollama provider has three issues that degrade tool-calling behavior and context management:
parseOllamaModelsetsmaxTokensto the fullcontextWindow. SincegetModelMaxOutputTokensreserves 20% of the window for output, this causes the context to be condensed far earlier than necessary.convertToOllamaMessagesalways sends tool results with the"user"role, so the model cannot distinguish tool results from actual user messages.additionalPropertiesin tool schema: The tool parameter schema includesadditionalProperties, which is not part of Ollama's tool schema definition and breaks tool-calling templates on some models.To Reproduce
Steps to reproduce the behavior:
Expected behavior
maxTokensshould reflect max output tokens (not the full context window), inheriting the sane default (4096)."tool"role withtool_namewhen the correspondingtool_useblock is known.additionalPropertiesshould be stripped from tool parameter schemas.What version of zoo are you running
latest
Additional context
The fix tracks
tool_useIDs to tool names so tool results can be sent with the correct role, inherits the defaultmaxTokens, and stripsadditionalPropertiesfrom tool schemas.