Skip to content

feat: Mattermost channel handler (DM mode)#1242

Open
msaidf wants to merge 2 commits into
nextlevelbuilder:devfrom
msaidf:feat/mattermost-channel
Open

feat: Mattermost channel handler (DM mode)#1242
msaidf wants to merge 2 commits into
nextlevelbuilder:devfrom
msaidf:feat/mattermost-channel

Conversation

@msaidf

@msaidf msaidf commented Jun 18, 2026

Copy link
Copy Markdown
Contributor

Changes

Adds native Mattermost support to GoClaw, enabling DM-based agent interactions through Mattermost servers.

Files:

  • internal/channels/mattermost/channel.go — channel implementation with WebSocket connection
  • internal/channels/mattermost/factory.go — channel factory and config
  • internal/channels/mattermost/send.go — message sending logic
  • internal/config/config_channels.go — Mattermost config schema

Testing

Verified on a live deployment with 9 Mattermost bot accounts — all agents respond correctly in DM mode.

mrgoonie and others added 2 commits June 15, 2026 15:50
Add native Mattermost channel support to GoClaw gateway. The handler
polls for direct messages every 3 seconds and posts agent responses
back to the DM channel via Mattermost REST API.

- internal/channels/mattermost/channel.go: DM polling, inbound dispatch
- internal/channels/mattermost/send.go: outbound message posting + file uploads
- internal/channels/mattermost/factory.go: Factory + DB config loading
- Register TypeMattermost in channel type constants
- Add MattermostConfig struct to ChannelsConfig
- Wire factory in gateway.go and config fallback in gateway_channels_setup.go
@msaidf msaidf force-pushed the feat/mattermost-channel branch from 34aff22 to 7d5e484 Compare June 18, 2026 22:25
@msaidf msaidf changed the title feat: Mattermost channel handler + Discord binding-based agent routing feat: Mattermost channel handler (DM mode) Jun 18, 2026

@mrgoonie mrgoonie left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Summary: This is a useful direction, but this PR should not merge as-is. It adds a second, partial Mattermost implementation while an older Mattermost PR already covers the same channel surface more broadly.

Risk level: Medium

Mandatory gates:

  • Duplicate/prior implementation: overlap found with open PR #430 (feat: add Mattermost channel support in web dashboard), which already adds internal/channels/mattermost/*, config wiring, tests, and UI integration.
  • Project standards: issue found — this PR adds ~814 lines with no Mattermost tests and no UI/schema/i18n integration for DB-created channel instances.
  • Strategic necessity: clear value, but the implementation should be consolidated with #430 or explicitly supersede it instead of creating competing Mattermost channel code.
  • CI/checks: missing/no checks reported for this branch.

Findings:

  • Important: Duplicate/overlap risk. #430 is still open and implements the same Mattermost channel type plus broader files (internal/channels/mattermost/*, config, gateway registration, UI channel schema/i18n). Please either coordinate with #430 and make one successor PR, or explain why this narrower DM-only implementation supersedes #430 and close/retarget the duplicate path.
  • Important: No regression tests for the new channel. The PR introduces polling, API request helpers, chunking, upload, and DB credential parsing, but there are no tests for config normalization, chunkText, send/create-post behavior, first-poll watermark behavior, or error handling. At minimum, add unit tests around the pure helpers and HTTP-client behavior using a test server.
  • Important: SSRF/internal egress policy needs an explicit decision. server_url is used directly for authenticated outbound HTTP calls. That may be acceptable for operator-configured channel instances, but recent provider/web-fetch work is tightening internal URL boundaries; this PR should document the trust boundary and add validation or an explicit “operator configured Mattermost base URL” policy so this does not become an unreviewed internal-network dialer.

Next step: consolidate with #430 or clearly mark this PR as the chosen successor, add the missing tests, and document/validate the Mattermost server_url trust boundary before re-review.

@mrgoonie mrgoonie added agent:github-maintain Processed by github-maintain automation maintain:triaged Triaged by maintain workflow status:blocked Blocked by external dependency or decision labels Jun 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agent:github-maintain Processed by github-maintain automation maintain:triaged Triaged by maintain workflow status:blocked Blocked by external dependency or decision

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants