fix(slack): dispatch @bot !cmd as command in threads - #30592
Conversation
|
Fresh status check: all checks are green and the PR remains a focused Slack gateway bug fix (2 files, regression tests included). GitHub shows it as blocked only by the normal review/merge gate, not by CI. I believe this is ready for maintainer review when someone has bandwidth. |
teknium1
left a comment
There was a problem hiding this comment.
Thanks for isolating the mention-prefixed thread-command path. The underlying issue is still present on current main: plugins/platforms/slack/adapter.py:2631 only rewrites a raw leading !, while mention stripping at :2870-2872 does not re-normalize it; first-thread context is then prepended at :2888-2900 before command tagging at :2902-2905.
Problems
- The branch changes
gateway/platforms/slack.py, but Slack moved toplugins/platforms/slack/adapter.pyin5600105478ffde29d7566b45421b100eaa29c4ef; this needs a targeted port rather than a direct cherry-pick. - The proposed
original_text = textis after Slack block augmentation. Current main appends extracted/serialized blocks atplugins/platforms/slack/adapter.py:2655-2672; this can make a mention-prefixed command carry rich-text payload as command arguments. The related open #43533 covers that distinct command-content issue.
Suggested changes
- Port the normalization/context guard to the plugin adapter, and normalize commands before augmentation or skip augmentation for recognized commands.
- Add a combined mention-prefixed bang command with rich-text-block regression case.
Automated hermes-sweeper review.
2815a62 to
e9f9a0c
Compare
|
Final refresh complete at |
|
Thanks for the focused current-adapter port and regression coverage. I reproduced the same The distinction is:
That keeps The patches touch the same nearby adapter block, so I’m happy to rebase or fold #66069 into this PR if maintainers prefer one combined change. |
|
Merged via #69479 — your commit was cherry-picked/reapplied onto current main with your authorship preserved in git history: your mention-then-bang rewrite (earliest fix for this ordering class) was cherry-picked directly. Thanks for the contribution! |
What does this PR do?
Fixes mention-prefixed gateway commands in Slack threads. Inputs such as
@bot !neware now normalized after the bot mention is removed and before Slack rich-content augmentation, so they dispatch as commands instead of becoming conversational text or acquiring serialized block content as arguments.The command path also skips first-thread conversational-context backfill, which would otherwise prepend text before the slash and make command detection fail.
This is the targeted current-architecture port requested by the automated maintainer sweep; Slack now lives in
plugins/platforms/slack/adapter.py.Related Issue
N/A — this was reproduced in a live Slack thread; no separate upstream issue is open.
Type of Change
Changes Made
plugins/platforms/slack/adapter.py!commandinput after mention stripping.tests/gateway/test_slack.pyHow to Test
HOME=/tmp/hermes-ci-home scripts/run_tests.sh -j 1 tests/gateway/test_slack.py.@bot !newwith rich block content and confirm it dispatches/newwithout block serialization being appended as arguments.Checklist
Code
fix(scope):,feat(scope):, etc.)pytest tests/ -qand all tests passThe canonical full suite was run on the current-main rebase. It reported 27 failures and 8 timeout/collection files outside this two-file diff, in the macOS/environment-sensitive areas reproduced on clean current main. The complete Slack test file passes 221/221.
Documentation & Housekeeping
docs/, docstrings) — or N/Acli-config.yaml.exampleif I added/changed config keys — or N/ACONTRIBUTING.mdorAGENTS.mdif I changed architecture or workflows — or N/AScreenshots / Logs