You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When OpenCode loads skills from a Claude Code project, the system prompt reaches ~41KB, and the skills listing is serialized as XML tags (<available_skills>, <skill>, <description>, etc.). I'm thinking that this is causing qwen3-coder:30b to switch from OpenAI JSON tool-call format to its native HERMES XML format; OpenCode can't parse HERMES XML, so all tool invocations fail silently or log invalid Invalid Tool.
Reproduction
Open a project with 50+ Claude Code skills in .claude/skills/
Configure Ollama qwen3-coder:30b as the model (via @ai-sdk/openai-compatible provider pointing to http://localhost:11434/v1)
Run any prompt that requires a tool call (e.g. "list top-level directories")
The system prompt size and XML structure is the trigger. Verified via proxy logging between OpenCode and Ollama:
OpenCode system prompt with skills loaded: 41,804 bytes, contains XML-tagged skill list
With this prompt + 45 tools → model outputs HERMES XML (fails, invalid Invalid Tool)
With a minimal plain-text prompt + same 45 tools via direct Ollama API → model outputs valid OpenAI JSON tool_calls (succeeds)
Streaming with 45 tools in isolation works correctly, so it seems that this is not an Ollama streaming bug
The XML tags in the skills listing (<skill>, <description>, <location>) appear to signal to qwen3-coder that it should respond in XML, overriding the tool-call format the model would otherwise use. Note: I haven't confirmed whether it's the XML structure specifically or just the prompt length; a 41KB plain-text prompt as a control would settle it, but the XML hypothesis is the stronger lead given the model behavior.
Possible mitigations
Serialize skills in JSON or plain-text format instead of XML tags in the system prompt
Environment
.claude/skills/Problem
When OpenCode loads skills from a Claude Code project, the system prompt reaches ~41KB, and the skills listing is serialized as XML tags (
<available_skills>,<skill>,<description>, etc.). I'm thinking that this is causing qwen3-coder:30b to switch from OpenAI JSON tool-call format to its native HERMES XML format; OpenCode can't parse HERMES XML, so all tool invocations fail silently or loginvalid Invalid Tool.Reproduction
.claude/skills/qwen3-coder:30bas the model (via@ai-sdk/openai-compatibleprovider pointing tohttp://localhost:11434/v1)tool_callsresponseRoot cause analysis
The system prompt size and XML structure is the trigger. Verified via proxy logging between OpenCode and Ollama:
invalid Invalid Tool)tool_calls(succeeds)The XML tags in the skills listing (
<skill>,<description>,<location>) appear to signal to qwen3-coder that it should respond in XML, overriding the tool-call format the model would otherwise use. Note: I haven't confirmed whether it's the XML structure specifically or just the prompt length; a 41KB plain-text prompt as a control would settle it, but the XML hypothesis is the stronger lead given the model behavior.Possible mitigations
Related
promptfield is not sent as system message to Ollama-compatible local models #24239: agentpromptfield / system message handling with local models