pub fn sanitize_for_vlm(history: &[Message]) -> Vec<Message>Expand description
Filter history to a form OpenAI-compatible endpoints accept:
every tool message must be preceded by an assistant whose
tool_calls lists its tool_call_id. Orphans (e.g. left over from
a trim that dropped the assistant) are quietly removed.