@cloudflare/think@0.12.1
Patch Changes
-
58eea18Thanks @threepointone! - trigger a release -
#1839
62b90ebThanks @threepointone! - Preserve attachmentfetchMetadatathrough messenger event serialization so sub-agents can re-fetch files.When a conversation resolver routes a thread to a sub-agent Durable Object, the messenger event is run through
serializableMessengerEvent()before crossing the DO boundary. That serialization previously dropped everything exceptid,mediaType,name,size,text, andurlfrom each attachment — discardingfetch,raw, and (for adapters that store their platform identifier there) the only remaining handle on the file.For adapters like
@chat-adapter/telegram, the file identifier lives exclusively infetchMetadata.fileIdand the top-levelidis never populated, so photos became irretrievable inside a sub-agent (attachment.idandattachment.fetchwere both missing).MessengerAttachmentnow carries a serialization-safefetchMetadata?: Record<string, string>field that survives the sub-agent hop.toMessengerAttachment()copiesfetchMetadatafrom the underlying Chat SDK attachment and backfills the top-levelidfrom a known metadata key (id,fileId,mediaId,fileUniqueId) when the adapter doesn't set one. A downstream agent can usefetchMetadatatogether with the adapter'srehydrateAttachment()to reconstruct the download closure.