The catch-all branch in _deduplicate_messages (lines 244-253 of _message_adapters.py) deduplicates by (role, hash(content_str)), which means any two messages with the same role and identical content are treated as duplicates. This can incorrectly drop valid repeated messages — e.g., a user saying "yes" to confirm two separate things.
The tool-specific dedup branches (tool results by call_id, assistant tool calls by call_id tuple) are correct and should remain. The fix should either remove the catch-all branch or scope it more tightly (e.g., only dedup adjacent identical messages, or use message IDs from the AG-UI protocol).
Ref: #4640