You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(teams): deliver outbound files via data-URI activity attachments
Port upstream filesToAttachments (packages/adapter-teams/src/index.ts
~1006-1035) to Python. The Teams adapter previously dropped a Postable's
.files entirely -- post_message/edit_message never called extract_files,
so execution artifacts silently vanished.
Adds TeamsAdapter._files_to_attachments: resolves each FileUpload's bytes
via to_buffer(..., throw_on_unsupported=False), base64-encodes them, and
builds a Bot Framework attachment {contentType, contentUrl:
data:<mime>;base64,<b64>, name}. mime defaults to
application/octet-stream; files whose data can't be resolved to bytes are
skipped with a debug log (mirrors upstream's `if (!buffer) continue`).
post_message and edit_message now call extract_files and attach the
results: the adaptive-card branch appends file attachments after the card
attachment; the text branch sets attachments to the file attachments when
present.
Adds TestFileAttachments (5 tests): text+file, card+file (both
attachments present), edit_message+file, octet-stream default, and the
skip-unresolvable-bytes branch.
Bumps version to 0.4.29a3 and adds a CHANGELOG entry.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Copy file name to clipboardExpand all lines: CHANGELOG.md
+12Lines changed: 12 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,17 @@
1
1
# Changelog
2
2
3
+
## 0.4.29a3 (2026-05-29)
4
+
5
+
Python-only feature port. No upstream version change.
6
+
7
+
### Features
8
+
9
+
- **Teams now delivers outbound files via base64 data-URI activity attachments** — the Teams adapter previously dropped a `Postable`'s `.files` entirely: `post_message`/`edit_message` never called `extract_files`, so execution artifacts (CSVs, charts, etc.) silently vanished. This ports upstream `vercel/chat`'s `filesToAttachments` (`packages/adapter-teams/src/index.ts` lines ~1006-1035) to Python. A new `TeamsAdapter._files_to_attachments` resolves each `FileUpload`'s bytes via `to_buffer(..., throw_on_unsupported=False)`, base64-encodes them, and builds a Bot Framework attachment `{"contentType", "contentUrl": "data:<mime>;base64,<b64>", "name"}` (mime defaults to `application/octet-stream`); files whose data can't be resolved to bytes are skipped with a debug log (mirrors upstream's `if (!buffer) continue`). `post_message` and `edit_message` now call `extract_files` and attach the results: the adaptive-card branch appends file attachments after the card attachment, and the text branch sets `attachments` to the file attachments when present. This is the Teams half of outbound artifact parity and unblocks chinchill routing execution artifacts to Teams. **Caveat (inherited from upstream's design):** data-URI attachments inline the full file payload base64-encoded in the activity, so large files inflate the Bot Framework payload — the same size constraint upstream carries.
10
+
11
+
### Test quality
12
+
13
+
- Added 5 tests in `tests/test_teams_adapter.py` (`TestFileAttachments`): text+file, adaptive-card+file (both attachments present), `edit_message`+file, mime-type default to `application/octet-stream`, and the skip-unresolvable-bytes branch. Each delivery test round-trips or asserts the `data:<mime>;base64,...``contentUrl`, `contentType`, and `name`.
0 commit comments