feat: add multi-attachment delivery batching

This commit is contained in:
Goon committed 2026-06-12 17:33:54 +07:00
1 parent 515596c44c
commit 9cd57a920c
20 files changed
+954 -127

No files matched your search

+18
View File
@@ -105,6 +105,24 @@ Splitting is intentionally conservative. Replies containing fenced code, tables,
Progress messages are not added to session history by this behavior. Existing run timeline handling for explicit `block.reply` remains unchanged.
### Outbound Media Delivery
Agent tools can queue media files through `Result.Media`; the consumer converts
those entries into `OutboundMessage.Media` and preserves file order, MIME type,
filename, and optional captions.
- `send_file` accepts either the legacy single `path` + optional `caption`, or
`attachments: [{path, caption?}, ...]` for batch delivery of existing
workspace files.
- Telegram groups compatible outbound media into `sendMediaGroup` album chunks
of 2-10 items. Photo/video items can share a chunk; documents group only with
documents; audio groups only with audio. Voice-mode audio, singleton chunks,
oversized images sent as documents, and incompatible runs use the existing
ordered single-send fallback.
- Discord already sends multiple files plus optional text in one message.
- Slack and other media-capable channels keep ordered fallback behavior unless
their adapter advertises a stronger batch capability.
### Reasoning Delivery
Telegram channel config supports explicit reasoning delivery:
+21
View File
@@ -6,6 +6,27 @@ Significant changes, features, and fixes in reverse chronological order.
## 2026-06-12
### Multi-attachment outbound delivery (issue #172)
**Changes**
- Extended `send_file` with `attachments[]` so agents can queue multiple
existing workspace files in one tool call while preserving order and captions.
- Added caption propagation from tool result media through agent media results
into outbound channel attachments.
- Added Telegram media-group delivery for compatible batches with 2-10 item
chunks, plus ordered fallback for singleton, voice, oversized-image, or mixed
incompatible cases.
- Added explicit channel batch capability metadata for Telegram, Discord, and
ordered fallback channels.
**Tests**
- Added batch `send_file` regressions for happy path, duplicate rejection, and
all-or-nothing delivered-state handling.
- Added Telegram media-group chunking tests for compatible grouping, max-size
chunking, and non-groupable fallback.
### Operator trace CLI (issue #158)
**Changes**