Repository navigation
feat: Channel adapter abstraction with multi-agent Slack support (#63) - #156
Merged
Merged
Conversation
vybe
requested changes
Mar 23, 2026
vybe
left a comment
Contributor
There was a problem hiding this comment.
PR Validation Report — REQUEST CHANGES
The code quality and architecture are solid — the adapter abstraction is clean, SQL is properly parameterized, and the transport layer (Socket Mode + webhook) is well-separated. However, this is a new capability and per Trinity development workflow requires documentation updates across all tiers before merge.
Required Before Merge
- Changelog — Add entry to
docs/memory/changelog.mdwith timestamp and emoji - Requirements — Add entry to
docs/memory/requirements.md(new capability: channel adapters + Slack integration) - Architecture — Update
docs/memory/architecture.mdwith new DB tables (slack_workspaces,slack_channel_agents),adapters/module, and API endpoints - Feature flow — Create feature flow document for Slack message routing (message → adapter → router → agent → response)
Code Issues to Address
- Memory leak in rate limiter —
_rate_limit_bucketsinmessage_router.pynever prunes empty buckets. Add periodic cleanup of stale entries. - Configurable limits — Rate limit (30/60s), timeout (120s), and allowed tools list are hardcoded. Move to
settings_servicefor operational flexibility.
Suggestions (Non-blocking)
- Duck-typed
handle_verificationviahasattr()breaks the adapter abstraction — consider an optional method onChannelAdapterbase class - String-based error matching (
"at capacity","billing") is fragile — prefer structured error types - Step-by-step logging (10+ INFO lines per message) will create high volume — consider DEBUG level for intermediate steps
- Consider Redis-backed rate limiting for multi-instance deployments
Please address the required items and request re-review.
- Extract ChannelAdapter/ChannelTransport base classes for pluggable messaging
- Implement SlackAdapter with channel-based multi-agent routing
- Add Socket Mode transport (no public URL needed) + webhook fallback
- Auto-create Slack channels per agent on "Connect Slack"
- Per-agent channel routing via slack_channel_agents table
- chat:write.customize for agent identity on responses
- TaskExecutionService integration (audit trail, activity tracking, slots)
- Tool restrictions for public Slack users (WebSearch/WebFetch only)
- Rate limiting (30 msg/min per Slack user)
- PUBLIC_CHAT_URL moved to Settings DB with env fallback
- New DB tables: slack_workspaces, slack_channel_agents
Closes #63
…s, thread tracking, docs (SLACK-002) Fix memory leak in _rate_limit_buckets by adding periodic pruning of stale entries. Move hardcoded rate limit, timeout, and allowed tools to settings_service for operational flexibility. Add handle_verification() to ChannelAdapter base class replacing duck-typed hasattr() check. Downgrade step-by-step router logging from INFO to DEBUG. Add thread watching and writing mechanism for reply-without-mention support. Add required documentation: changelog, requirements, architecture (DB tables), and feature flow document.
- Encrypt bot_token in slack_workspaces table using AES-256-GCM (same pattern as subscription_credentials) - Backward compatible: plaintext xoxb- tokens auto-detected on read - Updated changelog with full SLACK-002 feature list - Updated architecture with webhook transport + encryption note - Updated security findings with encryption fix + health check follow-up Closes #63 Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
- Feature flow: added User Story, Frontend Layer, Backend Layer, Side Effects, Error Handling, Security Considerations, Testing sections - Changelog: added emoji prefix (✨) and time to timestamp Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
pavshulin
force-pushed
the
slack-improvements
branch
from
March 24, 2026 13:48
c4a99d4 to
d944f55
Compare
Resolve conflicts in changelog.md and main.py: - changelog.md: Keep main's new entries (round-robin, docs, recovery, MCP tools) at top, move SLACK-002 entry to correct chronological position (2026-03-23), restore Voice Chat date - main.py: Keep both startup blocks (orphaned execution recovery from main + Slack transport from PR) Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
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
Test plan
Closes #63
🤖 Generated with Claude Code