Skip to content

Comments

Add Channel trait, CLI adapter, and Telegram bot#29

Merged
bug-ops merged 1 commit intomainfrom
feat/m4/telegram-channel
Feb 5, 2026
Merged

Add Channel trait, CLI adapter, and Telegram bot#29
bug-ops merged 1 commit intomainfrom
feat/m4/telegram-channel

Conversation

@bug-ops
Copy link
Owner

@bug-ops bug-ops commented Feb 5, 2026

Summary

  • Channel trait abstraction for agent I/O with recv(), send(), send_typing() methods
  • CliChannel wrapping stdin/stdout via tokio::task::spawn_blocking
  • TelegramChannel adapter using teloxide 0.17 with mpsc-based message routing
  • Telegram user whitelist via telegram.allowed_users config
  • Bot commands: /start, /reset, /skills
  • AnyChannel enum dispatch for runtime CLI/Telegram selection
  • Agent refactored to Agent<P: LlmProvider, C: Channel> — uses channel instead of direct I/O
  • ZEPH_TELEGRAM_TOKEN env var activates Telegram mode, otherwise CLI

Test plan

  • 44 tests pass (cargo test --workspace)
  • Zero clippy warnings (cargo clippy -- -D warnings)
  • CLI behavior preserved (CliChannel wraps existing stdin/stdout logic)
  • Telegram mode activates only when ZEPH_TELEGRAM_TOKEN is set

Closes #21, closes #22

- Channel trait abstraction with recv/send/send_typing methods
- CliChannel wrapping stdin/stdout via tokio::task::spawn_blocking
- TelegramChannel adapter using teloxide with mpsc message routing
- Telegram user whitelist, bot commands (/start, /reset, /skills)
- AnyChannel enum dispatch for runtime channel selection
- Agent now generic over both LlmProvider and Channel

Closes #21, closes #22
@bug-ops bug-ops merged commit 7c47c83 into main Feb 5, 2026
@bug-ops bug-ops deleted the feat/m4/telegram-channel branch February 5, 2026 22:03
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.

Implement Telegram bot adapter with teloxide Define Channel trait and wrap CLI in it

1 participant