Skip to content
This repository was archived by the owner on Sep 23, 2026. It is now read-only.
This repository was archived by the owner on Sep 23, 2026. It is now read-only.

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

Description

@lcthe

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:

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    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