anomalyco / anomalyco/opencode

[BUG] opencode-go: gateway attaches oversized `name` (70 chars) — rejected by strict upstreams (meta/muse-spark)

Open
#47,619 1 comment 0 reactions 1 assignee View on GitHub

@fwang is already working on this.

Since Sep 6, 2026.

Dominant language
TypeScript
Stars
209k
Forks
27.5k
Avg merge
7h 2m
Merged PRs (30d)
384

Description

Description

Selecting any meta/muse-spark-* model through the opencode-go provider fails with an upstream validation error:

Error from provider (Console Go): Upstream request failed: [invalid_request_error] `name` must be at most 64 characters, got 70

The model itself is healthy (OpenRouter endpoint "Meta" direct, 100% uptime, tens of thousands of requests in the last 30 min). The failure is a request-shape problem: a name field of 70 characters is being attached somewhere in the opencode-go gateway chain, and the Meta upstream validates name ≤ 64 (OpenAI-compatible messages[].name / tool function.name limit). Most other providers silently ignore the oversized field — which is why only meta/muse-spark models fail and every other model works, masking the bug.

Environment
  • opencode 1.18.27 (macOS, arm64)
  • provider: opencode-go, model: muse-spark-1.3-contributor
  • Same failure on two different sessions, one with MCP servers disabled and a minimal session
Evidence

Local log (~/.local/share/opencode/log/opencode.log):

level=ERROR run=65000b03 message="stream error" providerID=opencode-go modelID=muse-spark-1.3-contributor session.id=ses_f89552f78ffe1LCsv7xXcswdSl error.error="AI_APICallError: Error from provider (Console Go): Upstream request failed: [invalid_request_error] `name` must be at most 64 characters, got 70"
Ruled out on the client side
Suspect Measurement Result
Session title (possible messages[].name source) 8 and 17 chars on the failing sessions ruled out
Tool names (MCP servers with long composite names) same error with MCP servers disabled (built-in tool names are short) ruled out
Model health OpenRouter activity: 100% uptime, single "Meta" endpoint not the cause

Since the error persists with MCPs disabled and short titles, the 70-char name is most likely injected by the opencode-go gateway itself (the request is attributed to app "Console Go" at OpenRouter) before reaching the OpenRouter → Meta hop.

Suggested fix

Stop sending the name field (or trim it to ≤ 64 chars) in requests forwarded by the opencode-go gateway, so strict OpenAI-compatible upstreams (e.g., Meta's muse-spark endpoint) accept the request.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.