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
{{ message }}
Repository navigation
Kimi K2 Thinking tool calling problems - missing arguments. #9878
I wanted try Kimi K2 Thinking (OpenCode Zen) model with opencode.
But if I ask any question - file tooling doesn't work.
Also I tried with another tools - for example playwright. It also cannot pass argument to tools
Example:
~ Writing command...
TypeError [ERR_INVALID_ARG_VALUE]: The argument 'file' cannot be empty. Received ''
Open wp.pl in browser.
⚙ playwright_browser_navigate [url=]
Plugins
No response
OpenCode version
1.1.28
Steps to reproduce
Login to OpenCode ZEN - Kimi K2 Thinking
Ask any question about project
Receive many: TypeError [ERR_INVALID_ARG_VALUE]: The argument 'file' cannot be empty. Received ''
The common thread is that certain models (especially newer/thinking models like Kimi K2) pass invalid or empty arguments to tools, causing validation failures. This appears to be a systematic issue with how some models format tool call arguments.
Feel free to ignore if none of these address your specific case.
Using opencode and Ollama, I’m having the same issue.
I tested the Qwen3-coder:30b and GLM 4.7 Flash:q4_k_m models. They can create a file with code (usually small snippets), but they can’t call it back to edit it.
Glm 4.7 flash:
~ Reading file...
Error: The read tool was called with invalid arguments: [
{
"expected": "string",
"code": "invalid_type",
"path": [
"filePath"
],
"message": "Invalid input: expected string, received undefined"
}
].
Please rewrite the input so it satisfies the expected schema.
Qwen3-coder:30b:
~ Reading file...
Error: The read tool was called with invalid arguments: [
{
"expected": "string",
"code": "invalid_type",
"path": [
"filePath"
],
"message": "Invalid input: expected string, received undefined"
}
].
Please rewrite the input so it satisfies the expected schema.
Activity
github-actions commentedon Jan 21, 2026
This issue might be a duplicate of existing issues. Please check:
The common thread is that certain models (especially newer/thinking models like Kimi K2) pass invalid or empty arguments to tools, causing validation failures. This appears to be a systematic issue with how some models format tool call arguments.
Feel free to ignore if none of these address your specific case.
fix: parse Kimi K2 Thinking tool calls with special tokens
benys commentedon Jan 24, 2026
Maybe newest opencode fixit ? i close
Rukasufall commentedon Jan 24, 2026
Using opencode and Ollama, I’m having the same issue.
I tested the Qwen3-coder:30b and GLM 4.7 Flash:q4_k_m models. They can create a file with code (usually small snippets), but they can’t call it back to edit it.
Glm 4.7 flash:
~ Reading file...
Error: The read tool was called with invalid arguments: [
{
"expected": "string",
"code": "invalid_type",
"path": [
"filePath"
],
"message": "Invalid input: expected string, received undefined"
}
].
Please rewrite the input so it satisfies the expected schema.
Qwen3-coder:30b:
~ Reading file...
Error: The read tool was called with invalid arguments: [
{
"expected": "string",
"code": "invalid_type",
"path": [
"filePath"
],
"message": "Invalid input: expected string, received undefined"
}
].
Please rewrite the input so it satisfies the expected schema.
Nickersoft commentedon Feb 26, 2026
Can confirm this is still happening with KIMI K2 on the latest of OpenCode (via OpenCode Zen) cc @benys. Might be worth reopening?