Skip to content

Kimi K2 Thinking tool calling problems - missing arguments. #9878

Closed

Description

@benys

Description

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

  1. Login to OpenCode ZEN - Kimi K2 Thinking
  2. Ask any question about project
  3. Receive many: TypeError [ERR_INVALID_ARG_VALUE]: The argument 'file' cannot be empty. Received ''

Screenshot and/or share link

Image

Operating System

Nixos

Terminal

Alacritty

Activity

  1. github-actions commented on Jan 21, 2026

    @github-actions
    Contributor

    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.

  2. added a commit that references this issue on Jan 24, 2026
    f3b4982
  3. benys commented on Jan 24, 2026

    @benys
    Author

    Maybe newest opencode fixit ? i close

  4. Rukasufall commented on Jan 24, 2026

    @Rukasufall

    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.

  5. Nickersoft commented on Feb 26, 2026

    @Nickersoft

    Can confirm this is still happening with KIMI K2 on the latest of OpenCode (via OpenCode Zen) cc @benys. Might be worth reopening?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingnixzenRelates to Zen

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions