# Maple AI Tool Calling Bug Report ## Issue Maple AI models don't use OpenAI-style tool calling format. All tested models return empty responses or text instead of making tool calls. ## Reproduction See `maple-tool-calling-bug-repro.ts` for a minimal, self-contained reproduction. **Test model:** `gpt-oss-120b` (chosen because it DOES support tool calling on Cerebras) **Expected behavior:** ```json { "role": "assistant", "tool_calls": [{ "type": "function", "function": { "name": "write", "arguments": "{\"path\":\"/tmp/maple-test.txt\",\"content\":\"Hello World from Maple!\"}" } }] } ``` **Actual behavior:** - Empty response (0 text chunks) - `hasText = true` but `textContent.length = 0` - No tool calls generated ## Models Tested (All Fail) 1. ❌ `mistral-small-3-1-24b` - Refuses tools ("I don't have the capability...") 2. ❌ `qwen2-5-72b` - Outputs tool syntax as text 3. ❌ `llama-3.3-70b` - Outputs tool syntax as text 4. ❌ `deepseek-r1-0528` - Uses custom format with special tokens 5. ❌ `gpt-oss-120b` - Returns empty response (this reproduction) 6. ❌ `deepseek-v31-terminus` - 400 Bad Request 7. ❌ `leon-se/gemma-3-27b-it-fp8-dynamic` - 500 Internal Server Error ## Why This Matters The **same base models work fine** through other providers: | Model | Cerebras API | Maple API | |-------|--------------|-----------| | gpt-oss-120b | ✅ `tool_call: true` | ❌ Empty response | | qwen3-coder-480b | ✅ `tool_call: true` | ❌ Not offered | | qwen2.5-72b | ✅ Available with tools | ❌ Returns text | Source: https://models.dev/api.json (database of 186 models with tool calling) ## Root Cause Analysis See `WHY_OPENCODE_WORKS_MAPLE_DOESNT.md` for full analysis. **TL;DR:** - OpenCode Zen uses models from providers (Cerebras, xAI, Alibaba) with `tool_call: true` - Maple serves models through encrypted enclaves but tool calling isn't configured - This isn't a model capability issue - it's an API configuration issue ## Environment - Runtime: Bun 1.2.23 - AI SDK: `ai` v4.x - Provider: `@ai-sdk/openai-compatible` - Maple SDK: Custom encrypted fetch (from opensecret-client) ## Request Please enable OpenAI-style tool calling for Maple models. The encryption/privacy features are great, but without tool calling, the models can't be used for agentic workflows. ## Contact Justin Moon ([@justinmoon](https://github.com/justinmoon)) Project: yeet - minimal coding agent (https://github.com/justinmoon/yeet)