Skip to content

Commit fde4234

Browse files
fix: require team membership for delegated session creation
Non-team-members who mention both @kaji and @owner could create delegated sessions. Now only teammates (added via !team add) can initiate delegation. Non-team-members are silently ignored. Bump version to 0.3.95
1 parent 118e79b commit fde4234

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

.opencode/plugin/mattermost-control/tools/connect.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -530,8 +530,14 @@ function setupWebSocketListeners(
530530
}
531531

532532
// Non-owner mentioned bot - only allow delegated session creation
533-
// They MUST also mention the session owner (e.g., "@kaji @christine fix this")
533+
// They MUST be a team member AND mention the session owner
534+
// e.g., "@kaji @christine fix this"
534535
// Just mentioning @kaji alone does nothing for non-owners
536+
if (!isTeamMember) {
537+
log.debug(`[Channel] Non-team-member @mentioned bot in unmapped thread - ignoring (channel: ${channel.id})`);
538+
return;
539+
}
540+
535541
if (ownerUserId && botUser) {
536542
const mentionedUsers = sessionOwnershipHandler.detectMentionedUsers(
537543
postData.message,

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "opencode-mattermost-control",
3-
"version": "0.3.94",
3+
"version": "0.3.95",
44
"description": "OpenCode plugin for remote control via Mattermost DMs",
55
"type": "module",
66
"main": ".opencode/plugin/mattermost-control/index.ts",

0 commit comments

Comments
 (0)