Skip to content

[Bug]: OpenCode Go + Kimi K2.6/K2.5 returns 'Provider returned error' on CLI 1.14.20 #23887

Closed as not planned

Description

@byungsker

Description

OpenCode Go provider works perfectly for all models except Kimi K2.6 and K2.5, which consistently return "Provider returned error". Other models (GLM-5, Qwen3.5 Plus, MiniMax M2.5/M2.7) under the same OpenCode Go subscription work fine.

Environment

  • OpenCode Version: 1.14.20
  • OS: macOS
  • Provider: OpenCode Go (paid subscription, $10/month)
  • Affected Models: kimi-k2.6, kimi-k2.5
  • Working Models: glm-5, glm-5.1, qwen3.5-plus, minimax-m2.5, minimax-m2.7

Steps to Reproduce

  1. Run opencode and connect to OpenCode Go via /connect
  2. Select kimi-k2.6 from /models
  3. Send any message (e.g., "hi")
  4. Observe: "Provider returned error" appears immediately

Evidence

  • Same API key works with Kimi on other clients: The exact same OpenCode Go API key works perfectly with Kimi K2.6 on:
    • OpenClaw gateway (same machine, different session)
    • OpenCode Zen provider (same machine, different provider selection)
  • This rules out API key invalidity or server-side Kimi outage.

Troubleshooting Already Attempted

  • Cleared ~/.local/share/opencode and re-authenticated
  • Cleared ~/.cache/opencode to force provider package re-download
  • Reinstalled opencode-ai globally via npm
  • Changed network (WiFi → mobile hotspot) to rule out IP-based blocking
  • Verified same API key works with other OpenCode Go models
  • Verified same API key works with Kimi on OpenCode Zen

Expected Behavior

Kimi K2.6/K2.5 should work through OpenCode Go provider, just like GLM-5 and Qwen3.5 Plus do.

Actual Behavior

Only Kimi models fail with a generic "Provider returned error" message. No detailed error code or HTTP status is exposed in the UI.

Additional Context

This appears similar to previously reported issues:

However, in this case the API key is definitively valid (works on Zen and other models), and the error persists across cache clears, reinstalls, and network changes.

Activity

  1. added
    coreAnything pertaining to core functionality of the application (opencode server stuff)
    on Apr 22, 2026
  2. github-actions commented on Apr 22, 2026

    @github-actions
    Contributor

    This issue might be a duplicate of existing issues. Please check:

  3. byungsker commented on Apr 22, 2026

    @byungsker
    Author

    I've already tried all workarounds mentioned in #16685 and #23665 (cache clear, reinstall, network change). The issue persists. My case includes K2.6 as well, and I've confirmed the API key works via Zen and OpenClaw. Please keep this open.

  4. byungsker commented on Apr 22, 2026

    @byungsker
    Author

    Update: Even with , the error is completely opaque:

    No HTTP status code, no response body, no provider-specific error details are exposed. This matches the exact behavior described in #23665 where the provider package swallows the actual Kimi/Moonshot API error.

  5. byungsker commented on Apr 22, 2026

    @byungsker
    Author

    Update: Even with --log-level DEBUG, the error is completely opaque. No HTTP status code, no response body, no provider-specific error details are exposed. This matches the exact behavior described in #23665 where the provider package swallows the actual Kimi/Moonshot API error.

  6. nathandavismem commented on Apr 22, 2026

    @nathandavismem

    I struggled to find a way to fix this issue without changing / custom build the opencode source code. I discovered that the problem seems came from the tool call, specifically related to registered MCPs. In my case, the "stitch" MCP was causing the error, once I removed it, everything ran smoothly without that persistent error. I suggest trying to remove any custom MCPs or configurations if you're seeing something similar.

  7. PedroCabral04 commented on Apr 23, 2026

    @PedroCabral04

    I struggled to find a way to fix this issue without changing / custom build the opencode source code. I discovered that the problem seems came from the tool call, specifically related to registered MCPs. In my case, the "stitch" MCP was causing the error, once I removed it, everything ran smoothly without that persistent error. I suggest trying to remove any custom MCPs or configurations if you're seeing something similar.

    this worked for me, thanks!

  8. byungsker commented on Apr 23, 2026

    @byungsker
    Author

    I struggled to find a way to fix this issue without changing / custom build the opencode source code. I discovered that the problem seems came from the tool call, specifically related to registered MCPs. In my case, the "stitch" MCP was causing the error, once I removed it, everything ran smoothly without that persistent error. I suggest trying to remove any custom MCPs or configurations if you're seeing something similar.

    Oh, I followed your instructions, and now Kimi is working perfectly! Thank you @nathandavismem ! 👍🏻
    In my specific case, Kimi started working as soon as I disabled my custom MCP, figma-console.

    However, while this serves as a temporary workaround, I'm not sure if the root cause of the problem has actually been resolved. Shouldn't Kimi—which I access via an OpenCode Go subscription—function without issues regardless of which MCP I happen to be using?

  9. chandankumar123456 commented on Apr 23, 2026

    @chandankumar123456

    I struggled to find a way to fix this issue without changing / custom build the opencode source code. I discovered that the problem seems came from the tool call, specifically related to registered MCPs. In my case, the "stitch" MCP was causing the error, once I removed it, everything ran smoothly without that persistent error. I suggest trying to remove any custom MCPs or configurations if you're seeing something similar.

    It worked for me, but i have remove complete mcp from the config

  10. nathandavismem commented on Apr 23, 2026

    @nathandavismem

    However, while this serves as a temporary workaround, I'm not sure if the root cause of the problem has actually been resolved. Shouldn't Kimi—which I access via an OpenCode Go subscription—function without issues regardless of which MCP I happen to be using?

    Yeah, it's probably an issue with the provider tools handler. I've seen similar reports, but the root causes were different. Either way, Kimi providers should work fine with any MCP or plugins.

  11. nathandavismem commented on Apr 23, 2026

    @nathandavismem

    I struggled to find a way to fix this issue without changing / custom build the opencode source code. I discovered that the problem seems came from the tool call, specifically related to registered MCPs. In my case, the "stitch" MCP was causing the error, once I removed it, everything ran smoothly without that persistent error. I suggest trying to remove any custom MCPs or configurations if you're seeing something similar.

    It worked for me, but i have remove complete mcp from the config

    Have you tried removing partial MCPs?

  12. mokafolio commented on Apr 23, 2026

    @mokafolio

    I am getting the same error without any MCPs installed and there does not seem to be a way to resolve it in this case. I am in a deep session that seems borked with not way for me to continue as far as I can tell.

  13. Andrez421 commented on Apr 23, 2026

    @Andrez421

    Me costó encontrar una solución a este problema sin modificar ni compilar a medida el código fuente de OpenCode. Descubrí que el problema parecía provenir de la llamada a la herramienta, específicamente de los MCP registrados. En mi caso, el MCP "stitch" era el causante del error; una vez que lo eliminé, todo funcionó correctamente sin ese error persistente. Sugiero intentar eliminar cualquier MCP o configuración personalizada si experimentas algo similar.

    It worked for me, thank you very much

  14. sergeilapp commented on Apr 23, 2026

    @sergeilapp

    I struggled to find a way to fix this issue without changing / custom build the opencode source code. I discovered that the problem seems came from the tool call, specifically related to registered MCPs. In my case, the "stitch" MCP was causing the error, once I removed it, everything ran smoothly without that persistent error. I suggest trying to remove any custom MCPs or configurations if you're seeing something similar.

    I was able to resolve the issue by disabling Stitch MCP. I left my other MCP servers enabled. Thanks for the suggestion.

  15. 24 remaining items

  16. removed
    coreAnything pertaining to core functionality of the application (opencode server stuff)
    on May 3, 2026
  17. rekram1-node commented on May 4, 2026

    @rekram1-node
    Contributor

    Is anyone still having this issue?

  18. jc01rho commented on May 4, 2026

    @jc01rho

    I have this just now from kimi and deepseek in GO, but i dont know this is diffrent issue :(

    kimi

    Server: cloudflare\n\nBody:\n{\"error\":{\"message\":\"Error from provider: Provider returned error\",\"code\":400,\"metadata\":{\"raw\":\"{\\\"error\\\":{\\\"message\\\":\\\"thinking is enabled but reasoning_content is missing in assistant tool call message at index 13\\\",\\\"type\\\":\\\"invalid_request_error\\\"}}\",\"provider_name\":\"Moonshot AI\",\"is_byok\":true}},\"user_id\":\"user_2z4xm5LomaIHfsnVqMhFsWrVrGY\"}
    

    deepseek

    Server: cloudflare\n\nBody:\n{\"error\":{\"message\":\"Error from provider (DeepSeek): The `reasoning_content` in the thinking mode must be passed back to the API.\",\"type\":\"invalid_request_error\",\"param\":null,\"code\":\"invalid_request_error\"}}\n"
    
  19. desarrollador1IR commented on May 5, 2026

    @desarrollador1IR

    in my case, the problem was postman's MCP. I disabled it and now Kimi is working again lol

  20. rekram1-node commented on May 5, 2026

    @rekram1-node
    Contributor

    Ill get my PR across the finish line to fix

  21. Anferomol commented on May 14, 2026

    @Anferomol

    I'm having the same issue. with PI and my IDE Zed. Looks like reasoning is not supported. However, in my hermes-agent everything runs smoothly.

  22. jesusvillalbam commented on May 28, 2026

    @jesusvillalbam

    Having the same issue from Github Copilot Cli

    $env:COPILOT_PROVIDER_TYPE="openai"
    $env:COPILOT_PROVIDER_BASE_URL="https://opencode.ai/zen/go/v1"
    $env:COPILOT_MODEL="kimi-k2.6"

    2026-05-28T16:57:24.329Z [INFO] Using custom provider: type=openai, baseUrl=https://opencode.ai/zen/go/v1, wireApi=completions
    2026-05-28T16:57:24.329Z [INFO]
    2026-05-28T16:57:24.330Z [INFO] --- Start of group: Custom provider configured settings: ---
    2026-05-28T16:57:24.330Z [INFO] --- End of group ---
    2026-05-28T16:57:24.428Z [INFO] --- Start of group: Completion request configuration: ---
    2026-05-28T16:57:24.429Z [INFO] --- End of group ---
    2026-05-28T16:57:24.559Z [INFO] CompactionProcessor: Utilization 17.6% (22574/128000 tokens) below threshold 80%
    2026-05-28T16:57:24.560Z [INFO] --- Start of group: Sending request to the AI model ---
    2026-05-28T16:57:29.640Z [ERROR] error (Request-ID null)
    2026-05-28T16:57:29.650Z [ERROR] {
    "status": 400,
    "headers": {},
    "requestID": null,
    "error": {
    "message": "Error from provider: Provider returned error",
    "code": 400,
    "metadata": {
    "raw": "{"error":{"message":"Invalid request: tools.function.parameters is not a valid moonshot flavored json schema, details: \u003cAt path 'properties.recommendedAction.$ref': references must start with #/$defs/\u003e","type":"invalid_request_error"}}",
    "provider_name": "Moonshot AI",
    "is_byok": true
    }
    },
    "code": 400,
    "request_id": null,
    "ghRequestId": null,
    "name": "CAPIError",
    "message": "400 Error from provider: Provider returned error",
    "stack": "CAPIError: 400 Error from provider: Provider returned error\n at t.fromAPIError (file:///C:/Users/Jesus%20Villalba/AppData/Local/copilot/pkg/win32-x64/1.0.54/app.js:1023:1099)\n at z8e.getCompletionWithTools (file:///C:/Users/Jesus%20Villalba/AppData/Local/copilot/pkg/win32-x64/1.0.54/app.js:3971:32917)\n at process.processTicksAndRejections (node:internal/process/task_queues:104:5)\n at async z8e.getCompletionWithTools (file:///C:/Users/Jesus%20Villalba/AppData/Local/copilot/pkg/win32-x64/1.0.54/app.js:4002:3936)\n at async t.runAgenticLoop (file:///C:/Users/Jesus%20Villalba/AppData/Local/copilot/pkg/win32-x64/1.0.54/app.js:4954:5314)\n at async t.processQueuedItems (file:///C:/Users/Jesus%20Villalba/AppData/Local/copilot/pkg/win32-x64/1.0.54/app.js:4952:12797)\n at async t.processQueue (file:///C:/Users/Jesus%20Villalba/AppData/Local/copilot/pkg/win32-x64/1.0.54/app.js:4952:3448)\n at async t.send (file:///C:/Users/Jesus%20Villalba/AppData/Local/copilot/pkg/win32-x64/1.0.54/app.js:4950:4400)\n at async file:///C:/Users/Jesus%20Villalba/AppData/Local/copilot/pkg/win32-x64/1.0.54/app.js:7735:16969"
    }
    2026-05-28T16:57:30.651Z [INFO] --- End of group ---

  23. marked kimi2.6 error occurred #31340 as a duplicate of this issue on Jun 8, 2026
  24. petterssonjonas commented on Jul 26, 2026

    @petterssonjonas

    Is anyone still having this issue?

    Yes. #37496 I made an issue.
    I have tried with --pure, disabled oh-my-opencode, ponytail, herdr-agent-state plugins and icm. No luck, then i disabled Gitnexus mcp and that appears to be the offending actor.

  25. github-actions commented on Sep 25, 2026

    @github-actions
    Contributor

    To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.

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