#2653·kimi-cli

[Bug] OpenCode Go returns 400 because x-opencode-session header is missing

Author: lctheCreated Sep 19, 2026Updated Sep 19, 2026

Environment

  • Kimi Code version: Unknown
  • OS: Windows
  • Provider: OpenCode Go
  • Model: Unknown
  • Installation method: Unknown

Problem

When using Kimi Code with OpenCode Go, requests fail with the following error:

400 Error from provider (Console Go): Request is missing x-opencode-session and cannot be routed efficiently. Please see https://opencode.ai/docs/go/#where-can-i-use-it
provider.api_error · HTTP 400

Expected behavior

Kimi Code should send a stable x-opencode-session header for each conversation when making requests to OpenCode Go. The value should remain stable during one conversation and change for a new conversation.

Actual behavior

The request does not include the x-opencode-session header, so OpenCode Go rejects the request with HTTP 400.

Relevant documentation

OpenCode Go requires coding agents to send a stable session ID in the x-opencode-session header:

https://opencode.ai/docs/go/#where-can-i-use-it

The OpenCode Go documentation lists Kimi Code as a known problematic client and tracks the missing automatic session-header support as issue #3506.

Reproduction steps

  1. Configure Kimi Code to use OpenCode Go.
  2. Select an OpenCode Go model.
  3. Start a new conversation.
  4. Send any prompt.
  5. The request fails with HTTP 400.

Possible fix

Add a stable session identifier to all OpenCode Go requests:

http
x-opencode-session: <stable-session-id>

The session ID should be generated once per conversation and reused for all related requests, including auxiliary or tool-related requests if applicable.

Additional context

This appears to be missing session metadata rather than an authentication or model availability problem.