Let the channel mount open an attachment, not just name it #111
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#111
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?
CHANNEL_TOOLSinsrc/channel.rs:182is seven tools:download_attachmentis not among them, and/channeloffers only that list.So once #110 ships the attachment-carrying fix (#107), a session on the channel
mount learns that a file arrived —
attachment="m.image",filename="...", andthe caption as prose when the sender wrote one — and has no way to open it.
That is the actual answer to "am I receiving the pictures you send": after #110,
the notice, never the bytes. Worth fixing in the same stretch, because a
screenshot is how Julian shows a session what he is looking at, and a filename
is not a screenshot.
What to add
Add
download_attachmenttoCHANNEL_TOOLS. Routing already scopes the channelmount to one authenticated identity, and
DownloadAttachmentParamstakes aroom_idand anevent_id, so the tool cannot reach a room the identity is notjoined to. The existing
download_max_bytescap (checked against the event'sdeclared
info.sizebefore any media I/O) applies unchanged.Check while you are in there:
m.imagecontentcarries a
fileobject with the AES key rather than a plainurl.DownloadAttachmentResultdocumentsbody_base64as "file contents", whichreads as decrypted, but confirm it against a real encrypted event rather than
against the doc comment.
model is told how to reply and how to mark read; if it is not told it can
fetch an attachment it will report the filename and stop.
Acceptance
Julian sends one screenshot into
!nJqaJVNKzmgkUjjSLE:kampong.social, and thesession reports what is visibly in the image. Not that the tool is listed, and
not that it returned bytes — a deferred schema can be present while the fetch
fails, and base64 of a still-encrypted blob is bytes too.
Then the negative control: an
event_idin a room the identity is not joined tois refused, and an event whose declared size exceeds
download_max_bytesisrefused before any media I/O.
Related