Dashboard › opencode-lore › Provider and client gateway translation…
01a0a5d8-8c29-72d7-8e8c-16437a26fc76Assistant responses must never contain tool_result; tool results belong to user-side request/replay messages. When a streaming client receives a buffered routed response, synthesize a complete client-native stream rather than returning upstream JSON; include thinking, opaque blocks, and tool_use, or coding-agent calls disappear. For Vertex, strip x-api-key, anthropic-version, and anthropic-beta; Vertex uses OAuth, body anthropic_version, and GA cache_control. Treat req.system[0] as the sole authoritative billing header instead of searching user-controlled content. Round-trip Gemini reasoning summaries as reasoning, never merge them into visible answer text.