Return true only for payloads that tool_result_to_messages will map to
an actual image follow-up. Callers use this to avoid retaining malformed
image-shaped JSON without normal result-size bounds.
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.