Skip to content

feat(channels): add Mattermost channel support#1

Merged
evolv3ai merged 1 commit intomainfrom
feat/mattermost-channel
Feb 19, 2026
Merged

feat(channels): add Mattermost channel support#1
evolv3ai merged 1 commit intomainfrom
feat/mattermost-channel

Conversation

@evolv3ai
Copy link
Copy Markdown
Owner

Summary

  • Add Mattermost channel integration using async WebSocket (websockets) + REST API (httpx) - no new dependencies needed
  • Thread-aware replies: channel messages auto-thread, DMs stay flat, configurable via reply_in_thread
  • Auto-reconnect with exponential backoff (5s-60s) on WebSocket disconnect
  • Message splitting at 4000 chars for long responses (Mattermost limit: 16383)
  • Bot @mention stripping via configurable username field
  • Ported from picoclaw's Go implementation, avoiding the sync/async issues in HKUDS/nanobot#34

Files Changed

  • nanobot/config/schema.py - Add MattermostConfig with url, token, username, reply_in_thread, allow_from
  • nanobot/channels/mattermost.py - Full channel implementation (~260 lines)
  • nanobot/channels/manager.py - Register Mattermost in channel init

Configuration

{
  "channels": {
    "mattermost": {
      "enabled": true,
      "url": "https://your-mattermost-server.com",
      "token": "YOUR_BOT_ACCESS_TOKEN",
      "username": "botname",
      "replyInThread": true,
      "allowFrom": []
    }
  }
}

Test plan

  • REST API auth (/api/v4/users/me)
  • WebSocket connection + authentication_challenge
  • Inbound message receive (DM + channel)
  • Outbound message send via channel.send()
  • Threaded replies in channels (channelID/rootID encoding)
  • Message splitting (11K chars -> 3 chunks, all <= 4000)
  • Auto-reconnect after forced WebSocket disconnect (~4s recovery)
  • Echo round-trip (receive -> reply)

🤖 Generated with Claude Code

Async WebSocket + httpx implementation with thread-aware replies,
reconnect backoff, and message splitting. No new dependencies needed.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@evolv3ai evolv3ai merged commit 34687dc into main Feb 19, 2026
@evolv3ai evolv3ai deleted the feat/mattermost-channel branch February 19, 2026 05:12
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.

1 participant