Repository navigation
fix(channel): normalize bot-addressed commands - #803
Conversation
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 4fb24c7ba4
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| if commandIndex > 0 && !addressed { | ||
| return Invocation{}, ErrCommandForOtherBot |
There was a problem hiding this comment.
Preserve Slack app-mention commands
When a Slack app mention sends text like <@U123> /help, the Slack adapter leaves that mention in Message.Text and only marks is_mentioned without publishing the Slack bot user ID as a bot alias (internal/channel/adapters/slack/slack.go:538-567). This new rejection therefore treats the already-directed Slack command as ErrCommandForOtherBot and DecisionRejectNoop, so the later ExtractCommandText fallback that used to execute /help, /new, etc. is never reached. Please either pass Slack's self user ID as an alias or allow input.Directed messages to extract the command after an unmatched leading mention.
Useful? React with 👍 / 👎.
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: bab437a333
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| if token.Quoted || !isMentionToken(token.Value) { | ||
| return Invocation{}, ErrNotCommand | ||
| } | ||
| if aliasMatchesInvocation(token.Value, input.BotAliases) { |
There was a problem hiding this comment.
Preserve commands after punctuated bot mentions
When a group command is addressed with common punctuation after the mention, such as Telegram @MemohBot, /new or Slack <@UBOT>: /status, the adapters still mark the message as directed, and the previous ExtractCommandText path would execute the slash command after the whitespace. This parser now requires the pre-command token to be an exact alias match; the comma/colon makes the token fail matching, so the command is ignored or forwarded as normal chat instead of running.
Useful? React with 👍 / 👎.
| "attachments": len(attachments), | ||
| "is_mentioned": isMentioned, | ||
| "is_reply_to_bot": isReplyToBot, | ||
| "bot_alias": strings.TrimSpace(parsed.UserID), |
There was a problem hiding this comment.
Include Matrix localpart in bot aliases
Matrix mention detection accepts both the full MXID and its localpart (isMatrixBotMentioned checks @memoh:example.com and @memoh), but the new slash alias metadata only exposes the full MXID. In rooms where users type the localpart form that the adapter already treats as a mention, e.g. @memoh /new, ParseInvocation cannot match the leading token and treats the command as addressed to another bot, so the channel command is dropped.
Useful? React with 👍 / 👎.
Summary
Behavior
Test plan