Skip to content

Python: ag-ui _deduplicate_messages catch-all branch can drop valid repeated messages #4682

@moonbox3

Description

@moonbox3

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

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions