The mouth delivers media events as a typed line #2

Open
heimdall wants to merge 1 commit from heimdall/mouth-media-line into main
Member

m.image/m.file/m.audio/m.video reached Personas as a bare filename; content.url was dropped.

Change. bodyText in tools/persona-matrix-mouth.mjs renders a media event as [image filename="cat.png" mime=image/png size=2048 url=mxc://server/id] plus its caption (when filename is set and differs from body). Applied to the delivery text and to context lines. Encrypted attachments name file.url and carry encrypted; the key is never read. Every field is validated (mxc grammar, mime grammar, safe-int size, JSON-quoted filename), so a hostile filename cannot forge a line. Wire v1 unchanged (text is already a string in the tuple).

Fetch: not done, on purpose. A Persona turn is one tool-less connector call (Huginn crates/mind-body/src/persona.rs:13, :301) whose input is a single InputItem::UserText (connector.rs:73); ModelConnector's InputItem has only UserText/AssistantText/ToolCall/ToolResult/ReasoningState (schemas/transport_invocation.json), so no image variant and no file-read tool. Nothing in a Persona turn could use a downloaded file. Evidence is from the voidbot source mirror, which is stale; confirm against current Huginn/ModelConnector. A Self run (full session) could read a path, so a fetch-on-demand for Self runs is a separate follow-up.

Tests. 107 -> 113 passing in node --test tests/*.test.mjs (6 new media_* tests: line shape, caption, text untouched, hostile/encrypted/secret, byte cap, delivery+context with no media request and no token). Not run: .NET Bifrost.Web.Tests, live homeserver.

Not merged, not deployed.

🤖 Generated with Claude Code

`m.image`/`m.file`/`m.audio`/`m.video` reached Personas as a bare filename; `content.url` was dropped. **Change.** `bodyText` in `tools/persona-matrix-mouth.mjs` renders a media event as `[image filename="cat.png" mime=image/png size=2048 url=mxc://server/id]` plus its caption (when `filename` is set and differs from `body`). Applied to the delivery `text` and to context lines. Encrypted attachments name `file.url` and carry `encrypted`; the key is never read. Every field is validated (mxc grammar, mime grammar, safe-int size, JSON-quoted filename), so a hostile filename cannot forge a line. Wire v1 unchanged (text is already a string in the tuple). **Fetch: not done, on purpose.** A Persona turn is one tool-less connector call (Huginn `crates/mind-body/src/persona.rs:13`, `:301`) whose input is a single `InputItem::UserText` (`connector.rs:73`); ModelConnector's `InputItem` has only UserText/AssistantText/ToolCall/ToolResult/ReasoningState (`schemas/transport_invocation.json`), so no image variant and no file-read tool. Nothing in a Persona turn could use a downloaded file. Evidence is from the voidbot source mirror, which is stale; confirm against current Huginn/ModelConnector. A Self run (full session) could read a path, so a fetch-on-demand for Self runs is a separate follow-up. **Tests.** 107 -> 113 passing in `node --test tests/*.test.mjs` (6 new `media_*` tests: line shape, caption, text untouched, hostile/encrypted/secret, byte cap, delivery+context with no media request and no token). Not run: .NET `Bifrost.Web.Tests`, live homeserver. Not merged, not deployed. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
m.image/m.file/m.audio/m.video reached Personas as a bare filename and
dropped content.url. The delivery text now leads with
[kind filename mime size url], then the caption. Applies to the delivery
and to context lines. Wire v1 is unchanged. Nothing is fetched: a Persona
turn is a tool-less text call.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This pull request can be merged automatically.
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin heimdall/mouth-media-line:heimdall/mouth-media-line
git switch heimdall/mouth-media-line

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch main
git merge --no-ff heimdall/mouth-media-line
git switch heimdall/mouth-media-line
git rebase main
git switch main
git merge --ff-only heimdall/mouth-media-line
git switch heimdall/mouth-media-line
git rebase main
git switch main
git merge --no-ff heimdall/mouth-media-line
git switch main
git merge --squash heimdall/mouth-media-line
git switch main
git merge --ff-only heimdall/mouth-media-line
git switch main
git merge heimdall/mouth-media-line
git push origin main
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
GameCult/Bifrost!2
No description provided.