Skip to content

OpenCode: stream did not contain valid UTF-8 #22

@PixenKnight

Description

@PixenKnight

Summary

When using OpenCode as the interface and Krasis as my provider, completion/chat requests result in krasis-server saying the following:

[2026-04-14T01:37:07Z ERROR krasis::server] Failed to parse request: stream did not contain valid UTF-8

Setup

Model: Qwen 3 Coder Next
System: RTX 4080 Super | 64 GB RAM
Context: 170,656 tokens | KV cache: 2,000 MB
Decode: GPU | HCS: on | Think: off
opencode.json:

{
  "$schema": "https://opencode.ai/config.json",
  "provider": {
    "krasis": {
      "npm": "@ai-sdk/openai-compatible",
      "name": "Krasis",
      "options": {
        "baseURL": "https://localhost:8012/v1"
      },
      "models": {
        "Qwen3-Coder-Next": {
          "name": "Qwen 3 Coder Next"
        }
      }
    }
  }
}

Details

  • Krasis and Qwen work with krasis-chat
  • Opencode's server shows the following: ERROR 2026-04-14T01:37:07 +1ms service=llm providerID=krasis modelID=Qwen3-Coder-Next sessionID=ses_2765e885bffe12MBrTY6gg117P small=false agent=build mode=primary error={"error":{"name":"AI_APICallError","cause":{"code":"ConnectionRefused","path":"https://localhost:8012/v1/chat/completions","errno":0},"url":"https://localhost:8012/v1/chat/completions","requestBodyValues":{"model":"Qwen3-Coder-Next","max_tokens":32000,"top_p":1,"messages":[{"role":"system","content":"You are opencode...,"isRetryable":true}} stream error

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions