Skip to content

OpenCode Go provider fails with HTTP 400 MissingSessionID: x-opencode-session header is never sent #7865

Open

Description

@perejaslav

Environment

  • OpenHuman 0.64.15 (core 0.64.15, also seen on 0.63.12)
  • Windows 11 Pro x64
  • Provider: custom cloud provider opencode-go, endpoint https://opencode.ai/zen/go/v1, auth_style = "bearer"
  • Models: mimo-v2.5, muse-spark-1.3-contributor (assigned to all roles)

Problem
Every inference request to OpenCode Go is rejected:

model error: opencode-go returned HTTP 400 (MissingSessionID): Request is missing
x-opencode-session and cannot be routed efficiently.
Please see https://opencode.ai/docs/go/#where-can-i-use-it

The API key and endpoint are correct: list_models succeeds ([providers][list_models] slug=opencode-go fetched 37 models). Only chat and completion requests fail.

Affected paths seen in the logs:

  • agent.run_single: tinyagents harness and the driver
  • cron.agent_job
  • threads:title: title generation falls back to a default title

Cause
OpenCode Go requires clients to send a stable per-conversation session ID in the x-opencode-session header. It also asks clients to identify themselves with their own User-Agent (e.g. my-agent/1.0) instead of a generic SDK name. OpenHuman's OpenAI-compatible provider sends neither. The string x-opencode-session does not appear anywhere in the binary.

There is also no workaround through configuration. [[cloud_providers]] supports only id, slug, label, endpoint and auth_style, with no way to add custom headers.

Steps to reproduce

  1. Add a cloud provider with endpoint https://opencode.ai/zen/go/v1 and an OpenCode Go API key.
  2. Route the chat role to opencode-go:<any model>.
  3. Send a message in chat. The request fails with HTTP 400 MissingSessionID.

Expected
OpenCode Go models work like other OpenAI-compatible providers.

Suggested fix

  1. For OpenCode Go endpoints (opencode.ai/zen/go), send x-opencode-session: <stable id> on every request. A hash of thread_id would work for chat threads; background jobs (cron, title generation, summarization) could use their run or thread ID. The ID must stay the same for all requests in one conversation, including auxiliary calls such as title generation.
  2. Send a product-specific User-Agent, e.g. openhuman/0.64.15.
  3. Optionally, add a generic headers table to [[cloud_providers]] so users can unblock similar provider requirements without waiting for a release.

Activity

  1. added
    P1
    on Oct 18, 2026
  2. M3gA-Mind commented on Oct 19, 2026

    @M3gA-Mind
    Collaborator

    Thanks for the thorough report and root-cause analysis. We confirmed it on main: no cloud provider request sends x-opencode-session or a product User-Agent, and [[cloud_providers]] has no way to add headers (crates/openhuman-core/src/config/schema/cloud_providers.rs).

    A fix is in review in #8059. It sends a stable per-conversation x-opencode-session for OpenCode Go endpoints (shared by title generation and other auxiliary calls in the same conversation), adds an openhuman/<version> User-Agent, and adds an optional headers table to [[cloud_providers]]. It isn't merged yet, so there's no configuration workaround on current releases.

  3. senamakel commented on Nov 9, 2026

    @senamakel
    Member

    Sentry triage for tinyhumansai/team#46: these unresolved tauri-rust / tauri-react issues share this root cause.

    3 Sentry issue(s), 104 events in total, up to 6 users on a single issue. Releases seen: 0.64.15.

    Sentry Project Events Users Releases Last seen
    TAURI-RUST-1256 tauri-rust 53 6 0.64.15 2026-11-07
    TAURI-RUST-1290 tauri-rust 48 5 0.64.15 2026-11-02
    TAURI-RUST-16XN tauri-rust 3 1 0.64.15 2026-11-04

    104 events on 0.64.15; also present inside RUNCHAT per-turn issues (9 issues).

  4. M3gA-Mind commented on Nov 16, 2026

    @M3gA-Mind
    Collaborator

    Thanks again for the root-cause analysis. It's still the case on current main: [[cloud_providers]] entries can't carry extra headers, and nothing sends x-opencode-session. #8059 is the open fix (custom headers, a product User-Agent and the OpenCode Go session header) and is in review. This issue will close when it lands.

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

Metadata

Metadata

Assignees

Labels

P1

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions