Skip to content

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

@shawnpetros

Description

@shawnpetros

Problem

Slack group channels and threads are a shared human surface. A gateway-backed agent may receive events for conversations where the bot is present but is not being directly asked to respond. In those cases, the agent harness may intentionally return an explicit no-reply sentinel such as NO_REPLY to mean "leave the thread untouched".

Today, if that sentinel reaches the Slack final-send path, the adapter can treat it like ordinary assistant text and post the literal NO_REPLY into Slack. That turns an intentional silent turn into visible channel clutter. It also makes it harder for Slack deployments to use direct-ask gating without requiring a hard mention for every legitimate follow-up.

Expected behavior

When the final assistant response text is exactly NO_REPLY after trimming surrounding whitespace, the Slack gateway should treat the turn as intentional silence:

  • do not call Slack chat.postMessage
  • do not post the literal sentinel into the channel/thread
  • do not treat the turn as a generation failure or retryable empty response
  • optionally emit a debug log indicating an intentionally suppressed no-reply turn

Non-goals

  • This is not specific to any company, workspace, bot persona, or deployment.
  • This does not require Slack bots to only respond to hard mentions.
  • This is not a general solution for all empty model outputs.
  • This should not suppress ordinary messages that merely contain NO_REPLY as part of longer text.

Proposed implementation

Add a guard in the Slack adapter as close as practical to the final chat_postMessage call:

if text.strip() == "NO_REPLY":
    # intentional no-op for Slack
    return

The check should be exact after whitespace trimming. Longer messages such as "I would not use NO_REPLY here" should still send normally.

Acceptance criteria

  • Slack adapter suppresses exact NO_REPLY responses.
  • Surrounding whitespace is ignored for the sentinel check.
  • Longer messages containing NO_REPLY are still posted.
  • Suppressed sentinel turns do not call Slack chat.postMessage.
  • Add a regression test around the Slack send/dispatch path.

Related context

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Medium — degraded but workaround existscomp/gatewayGateway runner, session dispatch, deliveryplatform/slackSlack app adaptertype/featureNew feature or request

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions