Skip to main content

strip_message_media

Function strip_message_media 

pub fn strip_message_media(message: &ChatMessage) -> ChatMessage
Expand description

Degrade one message for a text-only route: a tool-result carrier loses exactly its declared attachments and keeps its body verbatim (legacy carriers included — a marker in tool body text is text, and rewriting it is the incident this contract exists to prevent); every other message has its media markers replaced with the placeholder as before, through the model-visible rewrite so signed envelope fields replay byte-for-byte.