mirror of
https://github.com/jasonxu114514/opencode2api.git
synced 2026-12-05 08:02:53 +00:00
Shaped free-model requests now look like an official CLI session on every lane. Each client tool is renamed to a sanitized, collision-free clint_ name and the full official tool set for the lane is appended (11 tools on the 1.x /zen lane, 13 on 2.x /inference and /zen/go). Requests without tools, with an empty array, or with a legacy functions array receive the official set too, and tool_choice, function_call and the tool-call history are rewritten to match. Responses, streaming and not, are restored to the names the client declared, including a Chat in a stream split across chunks. Unmapped names pass through, so an official tool the client never declared is never hidden or replayed.