Skip to content

"Provider returned error" hides actual Kimi/Moonshot API errors | Opencode GO | kimi k2.6 #23665

Closed as duplicate

Description

@SOUMITRO-SAHA

Description

I just purchased the OpenCode Go subscription today and was excited to use Kimi K2.6, but encountered this issue immediately.

When using Kimi K2.6 (or other Moonshot models) with OpenCode Go provider, errors from the upstream API are wrapped by the Vercel AI SDK with a generic "Provider returned error" message, losing the actual error details. Additionally, schemas with $ref cause "conflicting keywords found after $ref expansion" errors for Moonshot/Kimi APIs.

Root Cause:

  1. Vercel AI SDK wraps provider errors with "Provider returned error" and stores real error in metadata.raw
  2. Moonshot/Kimi APIs reject JSON schemas that have $ref with additional keywords like description after $ref expansion

Plugins

["opencode-ralph-loop"]

OpenCode version

1.4.11

Steps to reproduce

  1. Subscribe to OpenCode Go
  2. Configure OpenCode to use Kimi K2.6 model (opencode-go/kimi-k2.6)
  3. Run a prompt that triggers an API error (e.g., using tool calls)
  4. Error shows as generic "Provider returned error" instead of actual reason
  5. If using tools, get error: tools.function.parameters is not a valid moonshot flavored json schema, details: <At path 'properties.variantOptions': conflicting keywords found after $ref expansion: description>

Screenshot and/or share link

Image

Operating System

macOS 26.4.1

Terminal

zed ide terminal

Activity

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

    @github-actions
    Contributor

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

  3. Ralexs0096 commented on Apr 27, 2026

    @Ralexs0096

    +1

  4. rekram1-node commented on Apr 27, 2026

    @rekram1-node
    Collaborator

    This is an issue with one of your mcp servers having invalid tools

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 workingcoreAnything pertaining to core functionality of the application (opencode server stuff)

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions