mirror of
https://github.com/ultraworkers/claw-code.git
synced 2026-04-12 14:31:44 +08:00
Adds sanitize_tool_message_pairing() called from build_chat_completion_request()
after translate_message() runs. Drops any role:"tool" message whose
immediately-preceding non-tool message is role:"assistant" but has no
tool_calls entry matching the tool_call_id.
This is the second layer of the tool-pairing invariant defense:
-
|
||
|---|---|---|
| .. | ||
| src | ||
| tests | ||
| Cargo.toml | ||