Skip to content

fix(slack): suppress no-reply sentinel sends#30646

Closed
shawnpetros wants to merge 1 commit into
NousResearch:mainfrom
shawnpetros:fix/slack-no-reply-sentinel
Closed

fix(slack): suppress no-reply sentinel sends#30646
shawnpetros wants to merge 1 commit into
NousResearch:mainfrom
shawnpetros:fix/slack-no-reply-sentinel

Conversation

@shawnpetros

Copy link
Copy Markdown

What does this PR do?

Treats an exact NO_REPLY response from the Slack adapter as intentional silence instead of user-visible message text.

Slack channels and threads are shared human surfaces, so a gateway-backed agent may intentionally decide that a message should not receive a visible response. This adds a small final-send guard so the Slack adapter suppresses the explicit sentinel before chat_postMessage, while still allowing ordinary messages that merely contain the text NO_REPLY.

Reference PRs/context from this repo:

Related Issue

Fixes #30644

Type of Change

  • 🐛 Bug fix (non-breaking change that fixes an issue)
  • ✨ New feature (non-breaking change that adds functionality)
  • 🔒 Security fix
  • 📝 Documentation update
  • ✅ Tests (adding or improving test coverage)
  • ♻️ Refactor (no behavior change)
  • 🎯 New skill (bundled or hub)

Changes Made

  • gateway/platforms/slack.py
    • Adds _is_no_reply_sentinel() for exact trimmed NO_REPLY detection.
    • Suppresses exact sentinel sends before Slack chat_postMessage is called.
    • Returns a successful SendResult with suppression metadata so callers do not treat the turn as a send failure.
  • tests/gateway/test_slack_no_reply_sentinel.py
    • Adds regression coverage for exact sentinel matching.
    • Verifies whitespace-trimmed NO_REPLY does not call chat_postMessage.
    • Verifies longer messages containing NO_REPLY still post normally.

How to Test

  1. Run the targeted regression test:
    python -m pytest tests/gateway/test_slack_no_reply_sentinel.py -q -o 'addopts='
  2. Run the relevant Slack gateway tests:
    python -m pytest tests/gateway/test_slack.py tests/gateway/test_slack_approval_buttons.py tests/gateway/test_slack_no_reply_sentinel.py -q -o 'addopts='
  3. Optional broader gateway sweep:
    python -m pytest tests/gateway -q -o 'addopts='

Checklist

Code

  • I've read the Contributing Guide
  • My commit messages follow Conventional Commits (fix(scope):, feat(scope):, etc.)
  • I searched for existing PRs to make sure this isn't a duplicate
  • My PR contains only changes related to this fix/feature (no unrelated commits)
  • I've run pytest tests/ -q and all tests pass
  • I've added tests for my changes (required for bug fixes, strongly encouraged for features)
  • I've tested on my platform: Ubuntu/Linux container

Documentation & Housekeeping

  • I've updated relevant documentation (README, docs/, docstrings) — or N/A
  • I've updated cli-config.yaml.example if I added/changed config keys — or N/A
  • I've updated CONTRIBUTING.md or AGENTS.md if I changed architecture or workflows — or N/A
  • I've considered cross-platform impact (Windows, macOS) per the compatibility guide — or N/A
  • I've updated tool descriptions/schemas if I changed tool behavior — or N/A

For New Skills

N/A

Screenshots / Logs

Targeted regression:

$ python -m pytest tests/gateway/test_slack_no_reply_sentinel.py -q -o 'addopts='
...                                                                      [100%]
3 passed in 0.29s

Relevant Slack gateway tests:

$ python -m pytest tests/gateway/test_slack.py tests/gateway/test_slack_approval_buttons.py tests/gateway/test_slack_no_reply_sentinel.py -q -o 'addopts='
212 passed, 37 warnings in 2.02s

Broader gateway sweep was also run. It reached 5599 passed, 74 skipped; 6 Telegram tests failed on existing ParseMode repr expectations ('MarkdownV2' vs MARKDOWN_V2) and are unrelated to this Slack-only change.

@alt-glitch alt-glitch added type/bug Something isn't working P2 Medium — degraded but workaround exists platform/slack Slack app adapter comp/gateway Gateway runner, session dispatch, delivery labels May 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/gateway Gateway runner, session dispatch, delivery P2 Medium — degraded but workaround exists platform/slack Slack app adapter type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Slack gateway should treat explicit no-reply sentinels as intentional silence

2 participants