The channel drops images, and drops their captions with them #106
Labels
No labels
blocked
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
waiting-on-julian
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
jlxq0/matrix-mcp#106
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Three of Julian's messages never reached the agent tonight, each carrying a real instruction. They were found only by dumping the room and grepping for
msgtype != m.text. He asked "is it possible that you are not receiving images?" and the answer was yes, silently, for hours.Why nobody caught it: the two paths already disagree
The live path drops these events. Replay does not.
read_events_from_chunkfillsuntrusted_bodyfromcontent.bodyfor any event that has one — so a caption dropped live reappears on the next attach, hours later, out of order, with nothing marking it as late.That is why this presented as "Julian's messages are sometimes slow" rather than "images are dropped". A message that never arrives is noticed. A message that arrives late and unlabelled is explained away.
Where it happens
src/channel.rs:695— the live push path:is_text_messageat line 629 does the same for replay.The reasoning is sound and the premise is wrong
The comment at
channel.rs:622gives the reason:That is true when there is no caption. It is false when there is one, and this repository already knows it —
src/mcp.rs:5245, on the send side:So the answer to "is
bodya filename or a caption" exists in this codebase, 4,600 lines from the code that assumes the opposite. In Element on a phone, a photo with a caption puts the caption incontent.body— which is the traffic that actually arrives, and it is being dropped as though it were a filename.What is being asked for, and the part to push back on
Push image and file events too, with the body carried as a caption and the event marked as an attachment rather than a message, so the model can tell the difference between "somebody said this" and "somebody sent a file called this".
Downloading is already solved:
download_attachmentexists on/mcpand was used by hand to recover all three lost messages. Only the push path is missing.The filename-versus-caption distinction is the actual design question, and the spec rule the send path already implements is the obvious answer: if
filenameis present and differs frombody,bodyis a caption and belongs in the channel; if it is absent,bodyis a filename and should be labelled as one rather than pushed as prose.The team lead should push back if there is a better shape — in particular on whether an attachment event should carry the
mxc://so the model can fetch it, and on what the content sandbox does with a caption, since a caption is untrusted input from the same sender as any other message.