mirror of
https://gh-proxy.org/https://github.com/klinsmaya/CLIProxyAPI.git
synced 2026-11-08 09:26:52 +08:00
部分 OpenAI 兼容上游(自建 vLLM/sglang、部分中转网关)在流式 delta 中 不携带 tool_calls[].id。原逻辑要求非空 id 才发出 response.output_item.added/done 事件链,导致 Codex 侧完全收不到 函数调用(表现为工具全部不可用)。非流式路径同样产出 call_id 为空 的残缺 item。 缺失 id 时按 call_<responseID>_<choiceIdx>_<toolIndex> 合成确定性 call_id;chat completions 上游无状态,call_id 仅需单请求内自洽, 合成 id 可安全往返。 Ref #4219