anomalyco / anomalyco/opencode
[BUG] opencode-go: gateway attaches oversized `name` (70 chars) — rejected by strict upstreams (meta/muse-spark)
@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
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.