Skip to content

feat: add send_file built-in tool to send files from sandbox to Telegram#42

Open
chinkan wants to merge 9 commits into
mainfrom
feat/send-file-from-sandbox
Open

feat: add send_file built-in tool to send files from sandbox to Telegram#42
chinkan wants to merge 9 commits into
mainfrom
feat/send-file-from-sandbox

Conversation

@chinkan

@chinkan chinkan commented Jun 12, 2026

Copy link
Copy Markdown
Owner

Summary

  • Adds a send_file built-in tool allowing the AI agent to send files from the sandbox to the Telegram user
  • Follows the existing tool-based pattern — agent calls an explicit tool when it wants to send a file
  • Sandbox path validation reused via validate_sandbox_path()
  • File size checked before reading (50 MB Telegram limit)
  • Friendly status message: "📤 Sending a file"

What Changed

File Change
src/tools.rs Made validate_sandbox_path pub; added send_file ToolDefinition
src/agent.rs Added send_file execution arm with Telegram send_document API call, ChatId plumbing
src/platform/tool_notifier.rs Added "📤 Sending a file" friendly name

Test Plan

  • cargo build --release — builds clean
  • cargo clippy -- -D warnings — no warnings
  • cargo fmt --check — formatting clean
  • cargo test — 378 tests pass

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