Skip to content

Responses API: Zen Go gateway returns invalid "truncation": "" (empty string), breaking strict clients like Grok Build web_search #43732

Closed as not planned

Description

@toomanyopenfiles

Description

Summary

--
 
When calling the OpenCode Zen Go gateway (https://opencode.ai/zen/go/v1/responses) with model grok-4.5 and a web_search tool, the response object contains "truncation": "" (empty string). The OpenAI Responses API spec defines truncation as an enum of "auto" \| "disabled". Strict clients that deserialize this field as an enum fail on the very first SSE event of every response.
 
In Grok Build, the web_search tool fails with:
 

Failed to parse response: unknown variant ``, expected `auto` or `disabled` at line 1 column 315

 
As a result, web_search is completely unusable when pointed at this endpoint, even though the request itself succeeds server-side (the model does execute the search and generate an answer).
 

Environment

 

  • Endpoint: https://opencode.ai/zen/go (Responses API)
  • Model: grok-4.5
  • Client: Grok Build TUI, model configured with api_backend = "responses" and an OpenAI-compatible base_url pointing at the Zen Go endpoint
  • Date: 2026-08-21
     

Steps to reproduce

 
Direct call to the gateway (no proxy involved):
 

curl -s -N -H "Authorization: Bearer <OPENCODE_GO_API_KEY>" -H "Content-Type: application/json" \
-d '{"model":"grok-4.5","input":"test web search","tools":[{"type":"web_search"}],"stream":true}' \
https://opencode.ai/zen/go/v1/responses

 
First SSE event returned:
 

event: response.created
data: {"type":"response.created","sequence_number":0,"response":{"id":"resp_...","object":"response","created_at":...,"completed_at":null,"status":"in_progress","parallel_tool_calls":true,"temperature":1,"top_p":1,"max_output_tokens":null,"previous_response_id":null,"background":false,"truncation":"","top_logprobs":0,"max_tool_calls":null,"model":"grok-4.5","error":null,"incomplete_details":null,"output":[],"usage":null,"instructions":null,"tool_choice":"auto","tools":[],"reasoning":null,"text":{"format":{"type":"text"}}}}

 
Note "truncation":"" in the response object. The same empty value also appears in non-streaming responses.
 

Expected behavior

 
Per the OpenAI Responses API spec, truncation must be one of "auto" or "disabled". Return a valid value (e.g. "truncation":"auto") or null instead of an empty string.
 

Impact

 

  • Any client that strictly validates the Responses API contract fails on the first event of every streamed response, before any content can be processed.
  • For Grok Build, web_search configured to use grok-4.5 via OpenCode Zen Go is 100% broken — the tool errors out before returning any results.
     

Secondary observation (possibly related)

 
With the web_search tool and stream:false, the output contains a search_results item with 15 result entries, but every entry is an empty object {} (no title/url/content fields). The model still generates an answer from the search, but the structured results are empty — possibly another serialization issue in the same gateway.
 


Plugins

No response

OpenCode version

No response

Steps to reproduce

No response

Screenshot and/or share link

No response

Operating System

No response

Terminal

No response

Activity

  1. github-actions commented on Oct 21, 2026

    @github-actions
    Contributor

    To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.

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

Metadata

Metadata

Assignees

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