Skip to content

feat(bots): share thread attachments with delegating bots - #1423

Merged
nixuuu merged 3 commits into
devfrom
feat/thread-bot-attachments
Nov 28, 2026
Merged

nixuuu merged 3 commits into
devfrom
feat/thread-bot-attachments

Conversation

@nixuuu

@nixuuu nixuuu commented Nov 28, 2026 •

Copy link
Copy Markdown
Member

Change

  • Let a delegated thread send selected workspace files to its bot with message_delegating_bot. A single transaction queues the text and verified attachments together. Automated completion reports still carry text.
  • Keep a thread's attachments in the originating bot conversation, including callbacks to a Messages route. The bot can use send_attachment with an attachment ID to share a file in that same conversation under the existing approval policy and delivery limits.
  • Reuse the existing viewers for supported images, video and text. Other files are downloadable. External previews depend on the messenger. Attachment forwarding supports threads and bots served by the same gateway. Linked-computer callbacks and routines continue to carry text.

Thanks to @marcinniewinski for reporting the missing attachment path.

Verification

  • On Linux, format and lint passed for the 23 edited TypeScript files at 8cc4fda48. The agent-bus tool schema tests passed (6 tests).
  • CI covers repository-wide checks and the two gateway regressions for a private bot chat and a Slack callback. They verify typed attachments, same-conversation delivery, rejection across conversations, and an unchanged text-only completion report.
  • Live Slack delivery and interactive browser and mobile rendering were not tested. The feature reuses the existing message attachment renderer for each client.

Copy audit

  • The tool descriptions identify how to select files and which conversation receives them. Errors explain why a transfer was refused and how to proceed where applicable. The messenger tool distinguishes a queued file from confirmed delivery.
  • Existing attachment controls, labels, and failure states are reused.

@nixuuu
nixuuu enabled auto-merge (squash) November 28, 2026 10:01
@nixuuu
nixuuu merged commit dfdf57e into dev Nov 28, 2026
25 checks passed
@nixuuu
nixuuu deleted the feat/thread-bot-attachments branch November 28, 2026 10:16
nixuuu added a commit that referenced this pull request Nov 29, 2026
When Slack refused a reply with files, the bot could list the attachment
ID returned by its first send. Reusing that ID in the same Slack thread
failed because the gateway looked only at files referenced by messages.
It now also resolves files queued for replies in that conversation and
context epoch.

A private bot turn can also pass its conversation attachment IDs to the
granted Canopy Slack posting tool, including files received from a
delegated thread. The bot can send a file-only reply to a specific
parent timestamp. The Slack adapter shares the files after uploading all
of them. Existing account and channel approval rules apply.

Fixes: #1423

## Verification

- Reproduced a refused delivery followed by an explicit retry in the
same thread. Verified the file digest and destination, and rejection of
that ID in another thread of the same channel.
- Verified exact file bytes and parent timestamp using the private bot
entry point with a real gateway and worker and a local Slack transport.
A different private chat's file was refused before upload.
- The focused messenger-origin suite (16 tests), Slack post approval
suite (2 tests), Slack file adapter suite (2 tests), gateway typecheck
and lint on changed files passed locally. The full gate runs in CI. Live
Slack installation and delivery were not exercised.

## Copy audit

A file-only post now confirms the file count after Slack accepts the
share. Approval cards include filenames and sizes alongside the
destination. Reviewed against docs/copy.md §8.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant