feat(mattermost): Add directory adapter for channel/user name resolution#19265
Closed
oskarmodig wants to merge 4 commits intoopenclaw:mainfrom
Closed
feat(mattermost): Add directory adapter for channel/user name resolution#19265oskarmodig wants to merge 4 commits intoopenclaw:mainfrom
oskarmodig wants to merge 4 commits intoopenclaw:mainfrom
Conversation
…AllowFrom When a message in a channel is dropped because the sender is not in groupAllowFrom (e.g. another agent's bot reply), the message is now saved as pending history. This preserves conversation context so that when an agent is later @mentioned, it sees the full conversation including other agents' replies. Previously, the early return in the groupAllowFrom check meant these messages were silently discarded with no history record, causing agents to miss parts of multi-agent channel conversations.
Enables agents to send messages using channel names (e.g. target: "infra") instead of 26-character Mattermost IDs. - Add directory.ts: multi-account channel/user discovery - Add directory property to channel plugin - Fix normalize: bare names fall through to directory lookup - Fix looksLikeId: strict 26-char regex + DM format Closes openclaw#19264
…stPeers Both functions accepted a limit param but never applied it to the returned results. Slice entries before returning when limit is set. Reported by Greptile review bot.
Keep both directory adapter and new actions adapter from upstream.
8 tasks
tonydehnke
added a commit
to tonydehnke/openclaw
that referenced
this pull request
Feb 20, 2026
Previously, `#off-topic` was normalized to `channel:off-topic` which passed the `looksLikeId` check and skipped directory resolution, causing a 403 error when the bare name was used as a channel ID. Now `#name` targets return `undefined` from normalize (same as bare names), triggering the core's directory adapter to resolve the channel name to its actual Mattermost ID. This follows the pattern established by the directory adapter (openclaw#19265) with zero custom resolution code.
|
This pull request has been automatically marked as stale due to inactivity. |
Member
|
Closing this out because this branch is now mixed. The directory / name-resolution part of the PR is already in |
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.
Closes #19264
Enables agents to send messages using channel names (e.g.
target: "infra") instead of 26-character Mattermost IDs.Changes
src/mattermost/directory.ts(new)listMattermostDirectoryGroups— scans all enabled bot accounts (deduplicated by token), returns public + private channelslistMattermostDirectoryPeers— returns team members via first available clientsrc/channel.tsdirectoryproperty withlistGroups/listPeers+ live variantsDirectoryCachehandles caching; both variants call the same functionsrc/normalize.tsundefined→ falls through to directory lookuplooksLikeId: 26-char alnum + DM format (id__id)Testing
Tested live with 19 bot accounts across public and private channels.
Greptile Summary
Adds directory adapter for Mattermost to enable channel/user name resolution, allowing agents to send messages using friendly names instead of 26-character IDs.
Major changes:
directory.tsimplementslistMattermostDirectoryGroupsandlistMattermostDirectoryPeerswith multi-account scanning for comprehensive channel discoverynormalize.tsupdated to returnundefinedfor bare names, triggering directory lookup fallbacklooksLikeMattermostTargetIdnow uses strict 26-char alphanumeric pattern plus DM format validationmonitor.tsimproved to record pending history for messages from non-allowlisted senders, preserving conversation context for future@mentionsIssues found:
limitparameter—other channel implementations (msteams, matrix, feishu) apply it via.slice(0, limit)Confidence Score: 4/5
limitparameter handling inextensions/mattermost/src/mattermost/directory.tsbefore mergingLast reviewed commit: 67dc87d
(4/5) You can add custom instructions or style guidelines for the agent here!