Skip to content

OpenRouter/ Kimi K2 just stops working #1329

Closed

Description

@esafak

It said "Let me run the specific tests to see what's failing" but did not proceed. So I said "do it" and it still did not do anything. The status line does not say "working", indicating execution has stopped.

Activity

  1. tnypxl commented on Jul 25, 2025

    @tnypxl

    I wouldn't think this is an opencode issue. I think this is on openrouter's side. When I was doing model comparisons on via their site, Kimi k2 would stop working there as well. You might research if this issue is experienced on other platforms that offer this model.

  2. esafak commented on Jul 25, 2025

    @esafak
    ContributorAuthor

    I disagree. From the user's perspective it's opencode's problem; I am using it, and openrouter is a dependency. I don't have access to the openrouter API's response to opencode, and I don't care to. If openrouter times out or returns an error, opencode should deal with it.

    What would be a good diagnostic is for opencode to display which provider openrouter selected.

  3. pepperpepperpepper commented on Jul 26, 2025

    @pepperpepperpepper

    Can confirm that Kimi K2 through Groq works flawlessly. Never had this particular issue.

  4. tnypxl commented on Jul 26, 2025

    @tnypxl

    I disagree. From the user's perspective it's opencode's problem; I am using it, and openrouter is a dependency. I don't have access to the openrouter API's response to opencode, and I don't care to. If openrouter times out or returns an error, opencode should deal with it.

    What would be a good diagnostic is for opencode to display which provider openrouter selected.

    I think openrouter is responding successfully but with incomplete content from the LLM. Unless you grab the stop reason from the LLM, opencode probably won't think there is an issue. I've seen this in Zed editor and in Neovim.

  5. esafak commented on Jul 26, 2025

    @esafak
    ContributorAuthor

    It should be inspecting that and reporting the issue, not pretending nothing happened.

  6. self-assigned this
    on Jul 26, 2025
  7. thdxr commented on Jul 26, 2025

    @thdxr
    Member

    the problem is openrouter is hanging and not giving us anything - we need to add a timeout here

  8. andreagrandi commented on Jul 27, 2025

    @andreagrandi
    Contributor
    Image

    I confirm this problem. I experienced the same problem yesterday. At the beginning it seems to do something (it changed a few lines in a file), then completely stopped working.

    The problem is that if I switch to a model which works (ie sonnet-4 from GitHub Copilot) it behaves in the same way. I had to completely close the app and start a new session directly with GitHub Copilot / Sonnet-4 to continue working.

    I had to stop trying because I was burning paid tokens without doing any work 🫤

  9. andreagrandi commented on Jul 27, 2025

    @andreagrandi
    Contributor

    the problem is openrouter is hanging and not giving us anything - we need to add a timeout here

    the problem is also (not fixable by you, I know) Openrouter not giving us anything AND charging us anyway 🙄

  10. qydxyx commented on Jul 28, 2025

    @qydxyx

    Pretty sure it's openrouter's issue. when using function call, most providers of kimi k2 will stop for no reason. It's suggested to use official moonshot api. Some have also mentioned that groq api works well, and they offer k2 model with greater speed .

  11. esafak commented on Jul 28, 2025

    @esafak
    ContributorAuthor

    I reported it in their Discord. They said they are going to look into it, may stop supporting tool calling until it is fixed, and suggest using Groq or Moonshot as the provider.

  12. DanielTowerz commented on Jul 30, 2025

    @DanielTowerz

    Moonshot as provider presents the same behavior for me.

  13. mizchi commented on Jul 30, 2025

    @mizchi

    I discovered by looking at the Roo code that the tools all worked when I set it to openai-compatible.
    In my environment, the tools couldn't be used without this setting.

    {
      "$schema": "https://opencode.ai/config.json",
      "provider": {
        "moonshot": {
          "npm": "@ai-sdk/openai-compatible",
          "options": {
            "apiKey": "...",
            "baseURL": "https://openrouter.ai/api/v1"
          },
          "models": {
            "moonshotai/kimi-k2": {}
          }
        }
      }
    }

    It works with tools.

  14. esafak commented on Jul 30, 2025

    @esafak
    ContributorAuthor

    If so this is something that ought to be done in opencode, not in personal config files.

  15. daleal commented on Aug 2, 2025

    @daleal

    I have some weird example where the model (groq's K2 through an openrouter preset) actually made a change correctly, and then started outputting the same change to the console (1 change at a time, stopping immediately after showing the change), as if it didn't have access to what it had just done. And then I told it to just move on and it carried on just outputting 1 diff to the console and stopping there

  16. rekram1-node commented on Dec 28, 2025

    @rekram1-node
    Contributor

    [automated] Closing due to 90+ days of inactivity. Feel free to reopen if you still need this!

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

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions