Skip to content

opencode.ai/zen/go/v1 incompatible with Raycast AI custom provider #33138

Closed as duplicate

Description

@bojansandhaus

Bug Report

API: https://opencode.ai/zen/go/v1 (used as Raycast custom provider)
Model: mimo-v2.5 (affects all models)


Symptom

Raycast AI returns "Failed to decode the response" with "Coding key: id" on every request.


Root Cause 1: Message format mismatch

Raycast sends:

{"author": "user", "content": {"text": "hello"}}

The Xiaomi backend expects standard OpenAI format:

{"role": "user", "content": "hello"}

This returns 400 - "messages[0] role is not supported" with no id field.

Fix: Convert before forwarding:

for m in body.get("messages", []):
    if "author" in m:
        m["role"] = m.pop("author")
    if isinstance(m.get("content"), dict) and "text" in m["content"]:
        m["content"] = m["content"]["text"]

Root Cause 2: Unsupported tool types

Raycast sends built-in tools with non-standard types:

  • {"name": "web_search", "type": "remote_tool"}
  • {"name": "location-get-current-location", "type": "local_tool", ...}

The Xiaomi backend rejects with: 400 - "function is not set"

Fix: Strip tools before forwarding:

body.pop("tools", None)
body.pop("tool_choice", None)

Root Cause 3: Error responses missing id field

All 4xx/5xx error responses omit the id field. Raycast's Swift Decodable expects id in every JSON response and crashes when missing.

Fix: Include id in all error responses:

error_response = {
    "id": str(uuid.uuid4()),
    "error": {"code": "400", "message": str(e)}
}

Activity

  1. github-actions commented on Jun 20, 2026

    @github-actions
    Contributor

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

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