mirror of
https://github.com/diegosouzapw/OmniRoute.git
synced 2026-08-06 15:22:12 +03:00
Codex can emit a function_call with an empty/missing call_id; the matching function_call_output then becomes a role:'tool' message with no preceding tool_call, which the upstream rejects: "Messages with role 'tool' must be a response to a preceding message with 'tool_calls'". The orphan filter let it slip through because its guard (`&& rec.tool_call_id`) short-circuited on the empty id. Two changes in openaiResponsesToOpenAIRequest: - Skip function_call items with an empty call_id (mirrors the empty-name skip), so no dangling assistant tool_call with an unmatched id is emitted. - Drop ANY role:'tool' message whose tool_call_id (including empty/missing) has no matching tool_call, instead of only those with a truthy id. Closes #2893