Skip to main content

degrade_media_in_message

Function degrade_media_in_message 

pub fn degrade_media_in_message(message: &mut ConversationMessage) -> usize
Expand description

Replace image references in a single message with an omission note.

The per-message form of degrade_media_in_messages: callers that carry their own span bookkeeping (for example a provenance-preserving projection of seed rows) apply it row by row, while span-shaped callers keep using the slice form. Returns the number of image references degraded.

Tool-result carriers degrade only their declared attachments — the count header / array entries — and keep the body verbatim, because a marker in tool body text is text under the attachment-identity contract. A legacy carrier (no declaration) carries no attachments, so nothing degrades and its inline markers survive as text; that is the deliberate behaviour change for pre-upgrade spans.