anomalyco / anomalyco/opencode
glm-5.2 via zen gateway: 400 "Extra inputs are not permitted, field: 'workspace'"
@MrMushrooooom is already working on this.
Since Aug 26, 2026.
- Dominant language
- TypeScript
- Stars
- 209k
- Forks
- 27.5k
- PR merge metrics
- PR metrics pending
Description
Description
Requests to glm-5.2 through the zen gateway fail during normal client
usage with a 400 from the upstream provider:
Error from provider (Console Go): Upstream request failed: [invalid_request_error] Extra inputs are not permitted, field: 'workspace'
The same error is reproducible with a minimal curl adding a workspace
body field — see steps, where the full JSON response also echoes back the
exact value sent.
Z.ai's GLM models run a strict schema (extra=forbid) and reject any
non-standard body field. This is the same failure family as #33490
(instructions), #37771 (mcp/system), #36867 (chat_template_kwargs),
#36062 (extra_body), and #43089 (client metadata) — but the workspace
field is not covered by any of those reports.
Two isolation results from a minimal curl against the API-key path
(/zen/go/v1/chat/completions, non-streaming, no tools):
The field's presence alone reproduces the failure (see steps).
The gateway forwards unknown body fields verbatim — the upstream error
echoes back the exact value sent. Nothing strips workspace before the
upstream validator, so any layer that adds it produces a hard 400.
I have not been able to determine where workspace enters the body during
normal client usage — reporting in case you can see it server-side.
Plugins
opencode-pty, opencode-vibeguard, @tarquinen/opencode-dcp@latest
OpenCode version
v1.18.23
Steps to reproduce
Control — bare glm-5.2, minimal body → 200:
curl -sS https://opencode.ai/zen/go/v1/chat/completions
-H "Authorization: Bearer $OPENCODE_API_KEY"
-H "Content-Type: application/json"
-d '{"model":"glm-5.2","messages":[{"role":"user","content":"Reply with OK"}]}'
Same request with one added field → 400:
curl -sS https://opencode.ai/zen/go/v1/chat/completions
-H "Authorization: Bearer $OPENCODE_API_KEY"
-H "Content-Type: application/json"
-d '{"model":"glm-5.2","workspace":"test","messages":[{"role":"user","content":"Reply with OK"}]}'
Response:
{"error":{"type":"invalid_request_error","code":"invalid_request_error","message":"Error from provider (Console Go): Upstream request failed: [invalid_request_error] Extra inputs are not permitted, field: 'workspace', value: 'test'"}}
Screenshot and/or share link
Operating System
Manjaro Linux (Arch-based)
Terminal
GNOME Terminal, Zsh 5.9.1
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.