Enable dangerous tools in Telegram agent via ToolFactory injection#46
Merged
Conversation
- Add ToolFactory type to telegram module (same pattern as HeartbeatRunner) - Modify run_telegram_bot() to accept optional ToolFactory parameter - Store tool_factory in BotState - Extend agent with CLI tools when factory is provided in handle_chat() - Update daemon to inject create_cli_tools factory when starting Telegram bot - This allows Telegram agent to use bash, read_file, write_file, edit_file tools Co-authored-by: yiwang <142937+yiwang@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix Telegram agent to use file tools again
Enable dangerous tools in Telegram agent via ToolFactory injection
Feb 19, 2026
Contributor
|
@copilot fix ci format error |
Co-authored-by: yiwang <142937+yiwang@users.noreply.github.com>
Contributor
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Telegram agent dangerous tools support ✅
Implementation Complete
run_telegram_botto accept optional ToolFactory parameter (similar to HeartbeatRunner)handle_chatto extend tools using factory (similar to heartbeat at line 346-349 of runner.rs)Summary
Applied the same ToolFactory pattern used for HeartbeatRunner to the Telegram bot, enabling it to use dangerous tools (bash, read_file, write_file, edit_file) when running in daemon mode.
Changes Made
telegram.rs:
daemon.rs:
Pattern Applied
Exact same pattern as HeartbeatRunner (crates/core/src/heartbeat/runner.rs):
Security
localgpt daemon startOriginal prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.