Fix !command so @mentions resolve and code-wrapped commands run, like /command (CHOO-2342) - #313
Merged
abeldantas merged 3 commits intoSep 4, 2026
Conversation
… /command (CHOO-2342) !command is parsed straight from message text. After CHOO-2277 gave each agent an autocomplete user group, that broke bang commands: a typed @agent arrived as Slack markup, and code-wrapped commands were dropped silently. This fixes both.
Contributor
There was a problem hiding this comment.
Pull request overview
This PR restores parity between Slack !command and /command handling by ensuring agent @mentions are translated into plain @agent-name form for downstream dispatch, and by allowing whole-message code-wrapped bang commands to execute instead of being treated as ordinary chatter.
Changes:
- Translate inbound
!commandarguments via the collaboration adapter before dispatch (matching the existing message and slash-command behavior). - Treat whole-message Slack code spans (
`...`/...) as eligible command text for human senders, so code-wrapped!commandsexecute. - Add regression tests covering code-wrapped command intake and argument translation for thread mapping.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| core/switch_core/bridges/collaboration/bridge_core.py | Translates inbound command args via the adapter before sending the command event into Matrix. |
| core/switch_core/bridges/collaboration/slack/adapter.py | Unwraps whole-message code spans for human senders before bang-command detection. |
| core/tests/switch_core/bridges/collaboration/test_slack_adapter.py | Adds tests verifying code-wrapped !commands run (and do not double-bridge as messages) plus unwrap edge cases. |
| core/tests/switch_core/bridges/collaboration/test_command_thread_mapping.py | Extends test scaffolding and adds a regression test ensuring command args are translated via the adapter. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
amaudruz
requested changes
Aug 28, 2026
Collaborator
Author
amaudruz
approved these changes
Aug 29, 2026
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.


!command is parsed straight from message text. After CHOO-2277 gave each agent an autocomplete user group, that broke bang commands: a typed @agent arrived as Slack markup, and code-wrapped commands were dropped silently. In this PR we fix both, in the shared command funnel and the Slack adapter.