Skip to content

feat: Telegram send-side media — outbound image/file support#91

Open
DorianZheng wants to merge 5 commits into
feat/telegram-receive-sidefrom
feat/telegram-send-side-media
Open

feat: Telegram send-side media — outbound image/file support#91
DorianZheng wants to merge 5 commits into
feat/telegram-receive-sidefrom
feat/telegram-send-side-media

Conversation

@DorianZheng

Copy link
Copy Markdown
Collaborator

Implements outbound image/file sending via Grammy's sendPhoto/sendDocument API.

  • Detects workspace attachment paths in outbound messages
  • Routes to sendPhoto/sendDocument instead of plain sendMessage
  • Includes path traversal containment and partial-delivery notices
  • Regression tests included

Base branch: feat/telegram-receive-side (receive-side was implemented in a prior item)

Dune Developer 6 and others added 5 commits April 23, 2026 13:21
…rtial-delivery notices

- When an agent message contains workspace attachment paths like
  (/workspace/group/attachments/image.jpg), route them to Grammy's
  sendPhoto/sendDocument via the Telegram Bot API instead of plain text.

- Security: extractWorkspaceAttachmentPaths now rejects any path whose
  segments include '..', preventing path traversal extraction at the
  source. The new wrapTelegramDriverForMedia wrapper adds a second
  containment check after path.resolve() to guard against symlink escapes.

- Partial delivery: per-attachment failures are tracked individually.
  After the send loop, any failures produce a visible ⚠️ user-facing
  notice via sendMessage. Long-caption follow-up failures also send a
  visible notice.

- sendTelegramMedia is injectable via AgentRuntimeOptions for testing.

- Regression tests added:
  - rejects path traversal in outbound Telegram attachment paths
  - sends visible error notice when second attachment fails to deliver

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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