feat: Add pluggable channel system for remote messaging via Telegram#410
Merged
feat: Add pluggable channel system for remote messaging via Telegram#410
Conversation
Add a transport-agnostic channel abstraction that lets external messaging platforms (Telegram, WhatsApp, etc.) act as inbound/outbound bridges to the agent. Channel messages flow through the existing ConversationRepository and MessageQueue, reusing the agent's session management and auto-compaction. - Channel interface (domain.Channel) with Start/Send/Stop lifecycle - ChannelManager service with registry, auth allowlist, EventBridge routing - Telegram channel implementation using go-telegram/bot SDK (long-polling) - Per-channel allowlist security (secure-by-default: empty list rejects all) - Full documentation, Docker Compose example, and test coverage Closes #380
5065eb3 to
9ce8847
Compare
Adds a configurable max_workers setting (default: 5) that caps the number of agent subprocesses running in parallel. New messages wait for a slot when all workers are busy.
Split agent system prompt to custom instructions and system prompt configurations also allow the operator to completely remove the defaults when not needed. It's essential for minimal tests of the agent. Agent was tested via telegram and seems to work as expected now I might create an RC soon.
Contributor
Author
Previously, processSyncResponse saved content and tool_calls as separate assistant messages. This broke the API contract where assistant(tool_calls) must be immediately followed by tool(result), causing DeepSeek and other providers to reject the conversation history with "insufficient tool messages following tool_calls message".
…h command state management - Add SessionRolloverManager for automatic conversation rollover on idle/context limits - Introduce BackgroundTaskRegistry to unify A2A and shell task tracking - Add BackgroundTasksWaiter for batch-mode task draining - Fix bash command failure flow: carry all state in BashCommandCompletedEvent and emit side effects via tea.Sequence after EndToolExecution() state transition - Decouple channel manager from agent, add Telegram example with A2A browser agent - Add max_workers semaphore support for concurrent agent subprocesses
…Telegram channel Tested with Anthropic models, still need to test it with Ollama Gemma 4
Remove unused ChannelMessageReceivedEvent/ChannelMessageSentEvent types, replace hand-written mock with counterfeiter-generated FakeChannel, switch cmd/channels.go from fmt.Println to structured logger, and add WhatsApp registration placeholder to match existing config scaffolding.
It's cost effective and this example is not even about vision capabilities, so deepseek seek by default is totally fine to ilustrate the usage.
ig-semantic-release-bot bot
pushed a commit
that referenced
this pull request
Apr 15, 2026
## [0.101.0](v0.100.5...v0.101.0) (2026-04-15) ### 🚀 Features * Add pluggable channel system for remote messaging via Telegram ([#410](#410)) ([7c66058](7c66058)), closes [#380](#380) ### 🐛 Bug Fixes * Bump all golang versions to 1.26+ ([9f6e985](9f6e985)) ### 🧹 Maintenance * Bump development dependencies and GitHub Actions ([#409](#409)) ([92e1a6b](92e1a6b)) * **deps:** Bump github.com/go-vgo/robotgo from 1.0.1 to 1.0.2 ([#408](#408)) ([17ebf9b](17ebf9b)) * **deps:** Bump github.com/lib/pq from 1.12.0 to 1.12.3 ([#407](#407)) ([cc7ea5f](cc7ea5f)) * **deps:** Bump golang.org/x/crypto from 0.49.0 to 0.50.0 ([#412](#412)) ([00a611e](00a611e)) * **deps:** Bump golang.org/x/image from 0.38.0 to 0.39.0 ([d027cc3](d027cc3)) * **deps:** Bump modernc.org/sqlite from 1.48.0 to 1.48.1 ([#406](#406)) ([ae2f4d5](ae2f4d5)) * **deps:** Bump modernc.org/sqlite from 1.48.1 to 1.48.2 ([#411](#411)) ([eaedede](eaedede))
|
🎉 This PR is included in version 0.101.0 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
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.




Summary
infer channels-managercommand runs as a standalone long-running daemon, completely decoupled from the agentinfer agent --session-id <id>as a subprocess — the agent has no knowledge of channelsArchitecture
What's included
domain.Channel) withStart/Send/Stoplifecyclego-telegram/botSDK (long-polling, no webhook needed)infer channels-managercommand — standalone daemon with signal handling--session-idnow persists the provided ID even when the session doesn't exist yetdocs/channels.md), Docker Compose example, and test coverageKey design decisions
infer agent --session-id <id>, giving crash isolation and clean lifecyclechannel-{name}-{senderID}, so conversations persist across messages using the existing ConversationRepository and auto-compactTODOs
Implement approval flow for tools in telegramwill be a separate featureRefactor session rollover manager session groups - I'm not happy about the complexity, I need to refactor thisCloses #380