Skip to content

fix(slack): trust adapter routing after stripping self mention - #75406

Merged
kshitijk4poor merged 2 commits into
NousResearch:mainfrom
kshitijk4poor:salvage/70238-slack-identity-prompt
Jul 31, 2026
Merged

fix(slack): trust adapter routing after stripping self mention#75406
kshitijk4poor merged 2 commits into
NousResearch:mainfrom
kshitijk4poor:salvage/70238-slack-identity-prompt

Conversation

@kshitijk4poor

Copy link
Copy Markdown
Collaborator

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 5d747a91 added _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 test test_accepted_mention_prompt_trusts_adapter_routing — verifies stripped text, new prompt phrases present, old contradicting language absent.

Validation

Before After
Slack test suite 310 passed
Targeted test 3/3 passed
Ruff lint clean
E2E smoke 5/5 passed

Salvaged from #70238 by @KCAYAAI. Prompt text trimmed (jargon removed, ~70 tokens vs ~175 in the original PR).

Closes #70238

KCAYAAI and others added 2 commits July 31, 2026 17:45
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.
@alt-glitch alt-glitch added type/bug Something isn't working comp/plugins Plugin system and bundled plugins platform/slack Slack app adapter P3 Low — cosmetic, nice to have labels Jul 31, 2026
@alt-glitch

Copy link
Copy Markdown
Collaborator

This was generated by AI during triage.

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.

@kshitijk4poor
kshitijk4poor merged commit 1789e06 into NousResearch:main Jul 31, 2026
42 checks passed
@kshitijk4poor
kshitijk4poor deleted the salvage/70238-slack-identity-prompt branch August 5, 2026 07:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/plugins Plugin system and bundled plugins P3 Low — cosmetic, nice to have platform/slack Slack app adapter type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants