Bidirectional human-agent communication via Discord, Telegram, WhatsApp.
- Phase 1: Foundation (Ent schemas, daemon skeleton)
- Phase 2: Actor Router + tmux Adapter
- Phase 3: Chat Transport (omnichat integration)
- Phase 4: CLI Commands (send, interrupt, events, status)
- Phase 5: Outbound Messages (reply, channels)
- Phase 6: Polish (config validate, documentation)
Goal: Enable Claude Code to poll for inbound messages via MCP tools.
Problem: Currently inbound messages go to tmux via send-keys, but Claude Code can't read them programmatically during a session.
Solution: Add MCP tools that query the daemon for pending messages.
-
8.1. Add daemon client to MCP server
- InboundManager wraps daemon.Client
- Lazy connection (connects on first use)
- Handles case where daemon is not running
-
8.2. Implement
check_messagesMCP tool- Returns human messages for the agent
- Filters by role=human and type=human_message
- Parameters:
agent_id,limit
-
8.3. Implement
get_agent_eventsMCP tool- Returns all events (messages, interrupts)
- Supports pagination via
since_id - Parameters:
agent_id,since_id,limit
-
8.4. Implement
daemon_statusMCP tool- Check if daemon is running
- Returns agent count and providers
-
8.5. Agent ID resolution
- Uses AGENTCOMMS_AGENT_ID env var
- Falls back to "default" if not set
- Can be overridden per-call
-
8.6. Update documentation
- Added inbound tools to README
- Documented check_messages, get_agent_events, daemon_status
pkg/tools/inbound.go- InboundManager and MCP toolspkg/tools/inbound_test.go- Unit tests
Created comprehensive documentation site using MkDocs.
mkdocs.yml- MkDocs configurationdocs/index.md- Home/overview pagedocs/getting-started.md- Installation and setup guidedocs/cli.md- CLI commands referencedocs/mcp-tools.md- MCP tools referencedocs/configuration.md- Configuration guidedocs/architecture.md- System architecture
- Material theme with dark mode toggle
- Code syntax highlighting
- Navigation tabs and sections
- Search functionality
- Links to existing design documents
Migrated from split configuration (env vars + YAML) to a single unified JSON config.
- Single
config.jsonfile combines MCP server + daemon config - Environment variable substitution (
${VAR}syntax) for secrets agentcomms config initcommand to generate template- Backward compatible with legacy YAML config
- Full validation with helpful error messages
pkg/config/unified.go- UnifiedConfig struct with JSON tagspkg/config/unified_test.go- Unit testsexamples/config.json- Example JSON configcmd/agentcomms/commands.go- Added config init commanddocs/configuration.md- Updated for JSON configdocs/getting-started.md- Updated setup instructionsdocs/cli.md- Added config init documentation
Enabled multiple AI agents to coordinate via AgentComms.
- Agent status tracking (online/offline lifecycle)
- Source agent field in events for agent-to-agent messages
list_agentsMCP tool - discover available agentssend_agent_messageMCP tool - send message to another agentagent_messageIPC method for cross-agent routing- Agent message formatting with source prefix:
[from: agent_a] ...
-
7.1. Add
source_agent_idfield to Event schema- Distinguishes human→agent vs agent→agent messages
- Generated via
go generate ./ent
-
7.2. Implement agent status tracking
- Router tracks online status during RegisterAgent/UnregisterAgent
- AgentStatuses() method returns map of agent→status
- Database updated with status changes
-
7.3. Add daemon IPC method
agent_message- Creates event with source_agent_id and agent_id
- Routes to destination agent's actor
-
7.4. Add MCP tools
list_agents- lists agents with statussend_agent_message- sends to another agent
-
7.5. Update actor to handle agent messages
- Formats messages with source prefix
- Delivers to tmux pane via adapter
-
7.6. Add tests
- TestServerAgentMessage - IPC method
- TestRouterAgentStatuses - status tracking
- Unit tests for new types
-
7.7. Update documentation
- docs/mcp-tools.md - new tools
- docs/architecture.md - multi-agent flow
ent/schema/event.go- Added source_agent_id fieldinternal/router/router.go- Status tracking, AgentStatuses()internal/router/actor.go- handleAgentMessage()internal/daemon/server.go- handleAgentMessage()internal/daemon/protocol.go- AgentMessageParams, AgentMessageResultinternal/daemon/client.go- AgentMessage()pkg/tools/inbound.go- list_agents, send_agent_message
Multi-provider voice support via omnivoice registry pattern.
- CallSystem registry in omnivoice (RegisterCallSystemProvider/GetCallSystemProvider)
- Telnyx CallSystem provider (omnivoice-telnyx) - 50% cheaper than Twilio
- Provider selection via config (
phone_provider: "twilio"or"telnyx") - Observability hooks for TTS/STT/CallSystem (VoiceObserver, TTSHook, STTHook)
omnivoice-core- Registry types, observability interfaces, CallSystem clientomnivoice- Registry implementation, provider registrationomnivoice-telnyx- New Telnyx CallSystem provideragentcomms- Switched to registry-based provider lookup
pkg/voice/manager.go- Uses omnivoice.GetCallSystemProvider()go.mod- Added omnivoice-telnyx replace directive
Added call recording and SMS fallback when calls are not answered.
- Call recording via
AGENTCOMMS_ENABLE_RECORDING=true - SMS fallback when call not answered via
AGENTCOMMS_SMS_FALLBACK_ENABLED=true - Customizable SMS message template with
{message}placeholder - SMS support in both Twilio and Telnyx providers
# Enable call recording
AGENTCOMMS_ENABLE_RECORDING=true
# Enable SMS fallback
AGENTCOMMS_SMS_FALLBACK_ENABLED=true
# Custom SMS message (optional)
AGENTCOMMS_SMS_FALLBACK_MESSAGE="I tried calling but couldn't reach you: {message}"omnivoice-core- Added SMSProvider interface (callsystem/sms.go)omnivoice-twilio- Added SendSMS/SendSMSFrom methodsomnivoice-telnyx- Added SendSMS/SendSMSFrom methodsagentcomms- Config options, voice manager integration
pkg/config/config.go- Added EnableRecording, SMSFallbackEnabled, SMSFallbackMessagepkg/voice/manager.go- Recording option, SMS fallback logic
Added inbound SMS as a chat transport and webhook server for receiving Twilio/Telnyx callbacks.
- Webhook server for Twilio and Telnyx callbacks
- Inbound SMS handled as chat messages (like Discord/Telegram)
- Support for voice call status events
- Twilio signature validation for security
- Automatic integration with omnichat router
# Enable webhook server
AGENTCOMMS_WEBHOOK_ENABLED=true
AGENTCOMMS_WEBHOOK_PORT=3334 # Default: 3334
# Enable SMS as chat transport
AGENTCOMMS_SMS_ENABLED=true| Endpoint | Description |
|---|---|
/webhook/twilio/sms |
Incoming SMS from Twilio |
/webhook/twilio/voice |
Voice status callbacks from Twilio |
/webhook/telnyx/sms |
Incoming SMS from Telnyx |
/webhook/telnyx/voice |
Voice status callbacks from Telnyx |
/health |
Health check endpoint |
internal/webhook/server.go- HTTP webhook serverinternal/webhook/telnyx.go- Telnyx webhook parsingpkg/chat/sms/provider.go- SMS provider for omnichat
pkg/config/config.go- Added SMSEnabled, WebhookEnabled, WebhookPortpkg/chat/manager.go- Added InitializeSMS() and SMSProvider()
Added PostgreSQL support with Row-Level Security (RLS) for multi-tenancy.
- Database abstraction layer supporting SQLite and PostgreSQL
- Tenant context management (
internal/tenant) - Ent privacy rules for application-level tenant filtering
- PostgreSQL RLS policies for database-level isolation
- Backward compatible with single-tenant SQLite mode
# Multi-tenant PostgreSQL with RLS
database:
driver: postgres
dsn: postgres://user:pass@localhost:5432/agentcomms?sslmode=disable
multi_tenant: true
use_rls: true- Application-level filtering (Ent privacy rules) - Works on both SQLite and PostgreSQL
- Database-level RLS (PostgreSQL only) - Uses
SET LOCAL app.current_tenantper transaction
internal/tenant/context.go- Tenant context managementinternal/tenant/context_test.go- Unit tests (100% coverage)internal/database/database.go- Database abstraction with driver selectioninternal/database/database_test.go- Unit testsinternal/database/rls.go- PostgreSQL RLS policy applicationinternal/database/rls_test.go- Unit testsinternal/database/postgres_driver.go- RLS driver wrapperinternal/database/postgres_driver_test.go- Unit testsent/rule/tenant.go- Ent privacy rule for tenant filtering
internal/daemon/config.go- Added DatabaseConfig structinternal/daemon/daemon.go- Uses database.Open(), applies RLS policiesinternal/daemon/server.go- Extracts tenant from request, adds to contextinternal/daemon/protocol.go- Added TenantID to Request structent/schema/agent.go- Added Policy() methodent/schema/event.go- Added Policy() methodent/generate.go- Enabled privacy and entql featuresgo.mod- Added github.com/lib/pq v1.11.2
| Package | Coverage |
|---|---|
internal/tenant |
100.0% |
internal/database |
29.1% |
Note: Database coverage is limited because PostgreSQL-specific code requires a real PostgreSQL instance.
None
Message Flow:
Human (Discord) → Daemon → Event Store
↓
Claude Code ←── check_messages (MCP tool) ←── Daemon Client
Agent ID Resolution:
- MCP server needs to know which agent it represents
- Options:
- Environment variable:
AGENTCOMMS_AGENT_ID - Auto-register with daemon on startup
- Pass as parameter to each tool call
- Environment variable:
Event Filtering:
- Filter by
agent_idandrole=human - Support
since_idfor pagination - Return newest first or oldest first (configurable)
Added Slack as a chat transport provider.
- Socket Mode connection (no public webhook URL required)
- Real-time message handling via Events API
- Thread support (replies in threads)
- Reaction events (added/removed)
- Member joined/left events
- Message edited/deleted events
# Enable Slack
AGENTCOMMS_SLACK_ENABLED=true
AGENTCOMMS_SLACK_BOT_TOKEN=xoxb-your-bot-token
AGENTCOMMS_SLACK_APP_TOKEN=xapp-your-app-tokenomnichat- New Slack provider (providers/slack/adapter.go)agentcomms- Config, chat manager integration
providers/slack/adapter.go- Slack provider implementation
pkg/config/config.go- Added SlackEnabled, SlackBotToken, SlackAppTokenpkg/chat/manager.go- Added Slack provider initializationgo.mod- Added omnichat replace directive
docs/slack-setup.md- Slack App Setup Guidedocs/configuration.md- Added Slack config sectiondocs/getting-started.md- Added Slack env varsREADME.md- Added Slack to supported providersmkdocs.yml- Added Slack Setup to navigation
Added Gmail as a chat provider for outbound email notifications.
- Gmail API with OAuth 2.0 authentication
- Automatic browser-based OAuth flow on first run
- Token storage for subsequent sessions
- HTML and plain text email support
- Customizable subject via metadata
meshorthand for authenticated user's email
# Enable Gmail
AGENTCOMMS_GMAIL_ENABLED=true
AGENTCOMMS_GMAIL_CREDENTIALS_FILE=~/.agentcomms/gmail_credentials.json
# Optional
AGENTCOMMS_GMAIL_TOKEN_FILE=~/.agentcomms/gmail_token.json
AGENTCOMMS_GMAIL_FROM_ADDRESS=megogoogle- AddedSendSimple()method to gmailutil for easier email sendingomnichat- New Gmail provider (providers/email/gmail/adapter.go)agentcomms- Config, chat manager integration
providers/email/gmail/adapter.go- Gmail provider implementation
gmailutil/v1/service.go- AddedSendSimpleOptsandSendSimple()method
pkg/config/config.go- Added GmailEnabled, GmailCredentialsFile, GmailTokenFile, GmailFromAddresspkg/chat/manager.go- Added Gmail provider initializationgo.mod- Added gogoogle replace directive for local development
docs/gmail-setup.md- Gmail Setup Guidedocs/configuration.md- Added Gmail config sectiondocs/getting-started.md- Added Gmail env varsmkdocs.yml- Added Gmail Setup to navigation
Add Docker-based integration tests for PostgreSQL-specific functionality.
-
11.1. Add Docker Compose for PostgreSQL test environment
- PostgreSQL 16 container
- Test database initialization
-
11.2. Add integration tests with
//go:build integrationtagopenPostgres- test actual PostgreSQL connectionApplyRLSPolicies- test RLS policy creationDropRLSPolicies- test RLS policy removalsetTenantContext- test SET LOCAL executionExec/Query- test tenant context propagation
-
11.3. Add tenant isolation integration tests
- Create events with different tenant IDs
- Verify tenant A cannot see tenant B's data
- Verify RLS enforcement at database level
-
11.4. Add CI workflow for integration tests
- GitHub Actions with PostgreSQL service
- Run on PR and push to main
| Package | Current | Target |
|---|---|---|
internal/tenant |
100.0% | 100.0% |
internal/database |
29.1% | 90%+ |
- Multi-user support (calling different users based on context)
- Gemini CLI adapter (generates gemini-extension.json, agents/*.toml)
- Gemini CLI plugin generation for agentcomms