Telegram dropped every incoming photo, document, video and audio message: the default handler required message text, and nothing on the turn path knew media existed. The receiving path now closes the gap end to end. - telegram: extract the attachment from the update (largest photo, plus document, video, video-note, audio and voice kinds), download its bytes on the turn lane through getFile + the Bot API file link with a 20 MB gate, submit the turn with the attachment, and answer unsupported content kinds (sticker, location, contact, poll) with a clear notice instead of silence - messaging: Inbound carries turn-scoped transport media and MediaAttachment a Data field for in-process bytes; Message gains Media attachment metadata which stores persist (Postgres jsonb via migration 0020, memory store) with Data stripped at the persist boundary, and pb.Message carries the metadata on the gateway wire - gateway: TurnModelRequest threads the turn's media to the model seam - archied: the chat turn model merges the attachments into the final user message as ai-sdk image/file part entries, so vision-capable models see the file for the turn it arrived in; stored history keeps the placeholder note plus caption Session log: messages carry what was sent as data (the attachment metadata), not just prose. Transcript rendering of attachments and a re-look capability are tracked as archie-core-jaba.
9 lines
392 B
SQL
9 lines
392 B
SQL
-- +goose Up
|
|
-- Attachment metadata on stored chat messages (messaging.Message.Media):
|
|
-- type, platform attachment id, name, mime, size. The attachment bytes are
|
|
-- deliberately not kept -- they are turn-scoped -- so this is a JSON
|
|
-- metadata list, not a blob column.
|
|
ALTER TABLE messages ADD COLUMN media jsonb NOT NULL DEFAULT '[]';
|
|
|
|
-- +goose Down
|
|
ALTER TABLE messages DROP COLUMN media; |