fix(slack): trust adapter routing after stripping self mention - #75406
Merged
kshitijk4poor merged 2 commits intoJul 31, 2026
Merged
Conversation
Follow-up to PR NousResearch#70238. Remove 'free-response channel' and 'authorization' jargon from the model-facing prompt. Collapse the triple-negative 'do not ask / do not reject / do not stay silent' into a single directive. ~70 tokens vs ~175 in the contributor's version, same semantics.
Collaborator
Related to #70238: this is presented as its salvage, with the same adapter-routing correction but a deliberately trimmed prompt. It is an active successor rather than a duplicate disposition. |
Open
19 tasks
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.
Summary
The Slack identity prompt no longer contradicts the adapter's own mention stripping — the model trusts the adapter's routing decision instead of re-validating a mention that was already removed.
Root cause
Commit
5d747a91added_build_identity_prompt()which told the model: "Only treat a message as directed at you when it mentions @name specifically." But the adapter strips the bot's own<@U_BOT>mention from the text (line 5725) before the model sees it — so the prompt told the model to require a token that no longer existed. The model could refuse to respond, ask for a mention, or stay silent on validly-routed messages.Changes
plugins/platforms/slack/adapter.py: Rewrote_build_identity_prompt()— replaces the old "require a mention" language with "the adapter already routed this to you, don't re-validate." Preserves the humanization guard ("a mention of any other participant is not a mention of you"). Trimmed of internal jargon ("free-response channel", "authorization") and the triple-negative directive collapsed to a single concise instruction.tests/gateway/test_slack.py: New testtest_accepted_mention_prompt_trusts_adapter_routing— verifies stripped text, new prompt phrases present, old contradicting language absent.Validation
Salvaged from #70238 by @KCAYAAI. Prompt text trimmed (jargon removed, ~70 tokens vs ~175 in the original PR).
Closes #70238