@cloudflare/think@0.12.1

cloudflare/agents@cloudflare/think@0.12.1Jun 30, 2026by github-actions[bot]

AI Summary

Patch release fixing attachment metadata serialization to support file retrieval in sub-agents.

Key Highlights

  • Preserved `fetchMetadata` through messenger event serialization
  • Fixed file retrieval in sub-agents for adapters like Telegram

Full Release Notes

### Patch Changes

-   [`58eea18`](https://github.com/cloudflare/agents/commit/58eea18f74dec943a5e9df3d78135f8980c445c4) Thanks [@threepointone](https://github.com/threepointone)! - trigger a release

-   [#1839](https://github.com/cloudflare/agents/pull/1839) [`62b90eb`](https://github.com/cloudflare/agents/commit/62b90eba069285c53b5dd76ff942a2bedbd2dccc) Thanks [@threepointone](https://github.com/threepointone)! - Preserve attachment `fetchMetadata` through 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 except `id`, `mediaType`, `name`, `size`, `text`, and `url` from each attachment — discarding `fetch`, `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 in `fetchMetadata.fileId` and the top-level `id` is never populated, so photos became irretrievable inside a sub-agent (`attachment.id` and `attachment.fetch` were both missing).

    `MessengerAttachment` now carries a serialization-safe `fetchMetadata?: Record<string, string>` field that survives the sub-agent hop. `toMessengerAttachment()` copies `fetchMetadata` from the underlying Chat SDK attachment and backfills the top-level `id` from a known metadata key (`id`, `fileId`, `mediaId`, `fileUniqueId`) when the adapter doesn't set one. A downstream agent can use `fetchMetadata` together with the adapter's `rehydrateAttachment()` to reconstruct the download closure.