Skip to content

fix(ctx_discord_policy): 3.0.2 — a turn in ambient mode that ends in NO_REPLY stays silent instead of drawing Hermes' silence-marker notice - #577

Merged
GottZ merged 1 commit into
rootfrom
issue/dspsilence-ambient-turn-may-stay-silent
Nov 28, 2026
Merged

GottZ merged 1 commit into
rootfrom
issue/dspsilence-ambient-turn-may-stay-silent

Conversation

@GottZ

@GottZ GottZ commented Nov 28, 2026 •

Copy link
Copy Markdown
Owner

What was wrong

In a conversation (ambient) channel the bot reads along, and the plugin's prompt tells the model to answer exactly NO_REPLY when it has nothing to add. Hermes keeps such an answer silent only when the event says that no reply is expected (MessageEvent.reply_expected is False) or when allow_silence is configured (gateway/response_filters.py: silence_allowed). Hermes' Discord adapter never sets the field, so the marker was rejected (silence marker rejected on a user turn) and the channel got Hermes' notice instead:

⚠️ The model returned only a silence marker for a message that needed a reply. Try again or rephrase.

On the live server five of the nine Discord answers between 2026-11-26 and 2026-11-28 were this notice; four of them belonged to ambient turns (all four ambient turns of that period).

The change

  • dsp/adapt/interventions.py: the event gate on the adapter's handle_message (A10) sets reply_expected = False on the event of a route in ambient mode. Only an unset field is written, only on a Hermes whose event has the field. A message that addresses the bot (mention, reply, wake name, reaction) is a direct route and keeps Hermes' rule, so a bare marker there still draws the notice. If the mark fails, the error is logged and the event goes on as Hermes built it.
  • tests/contract/test_ambient_silence.py: through Hermes' real admission and handler, an ambient message of a member and of the operator reaches the pipeline with reply_expected is False; an addressed message in the same channel keeps None; Hermes' own silence_allowed accepts the first and refuses the second.
  • README: one clause ("and posts nothing when it has not"). Version 3.0.2.

Evidence

  • [executed] Red proof: with interventions.py at the base revision, 2 of the 3 new tests fail (Hermes 05c75446bc); with the change all 3 pass.
  • [executed] Plugin suites locally: unit 1296 passed / 164 skipped on Python 3.11 and on 3.14; contract 163 passed against v0.23.0, 04846730f3, 05c75446bc and c925e8bb (the revision the live server runs), 160 passed / 3 skipped against v0.22.4; tools/assemble_ui.py --check clean.
  • [not covered] A model's turn and the delivery of its answer: the tests stop at the event and at Hermes' rule function. The live check follows after the rollout.

Not changed

Hermes' rule itself, allow_silence, and direct turns: a model that answers an addressed message with a bare marker still gets the notice (seen once in the same period).

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features
    • Ambient Discord messages no longer trigger a bot reply when it has nothing to add. Directly addressed messages remain eligible for a response.
  • Documentation
    • Clarified when the bot participates in conversation channels and when it stays silent.
  • Chores
    • Updated the Discord integration to version 3.0.2.

…NO_REPLY stays silent instead of drawing Hermes' silence-marker notice

In ambient mode the bot reads along and the prompt lets the model answer
NO_REPLY. Hermes keeps a bare marker silent only for an event whose
reply_expected is False (or with allow_silence configured); its Discord
adapter leaves the field unset, so Hermes replaced the marker with the
notice "The model returned only a silence marker for a message that
needed a reply" and posted it into the channel.

The event gate (A10) now sets reply_expected = False on the event of a
route in ambient mode: only where the field exists and is still unset.
An addressed message keeps Hermes' rule and its notice. A failure of the
mark is logged and leaves the event as Hermes built it.

Observed on a live server: five of nine answers within three days were
that notice, four of them on ambient turns.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
@GottZ
GottZ requested a review from W4-NERF as a code owner November 28, 2026 15:36
@coderabbitai

coderabbitai Bot commented Nov 28, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The plugin now sets an unset reply expectation to false for ambient events when a bot binding exists. Tests cover ambient and addressed messages, and the response-filter contract. Plugin version references change to 3.0.2.

Changes: Discord policy plugin

Layer / File(s) Summary
Ambient reply expectation
integrations/hermes/plugin/ctx_discord_policy/dsp/adapt/interventions.py, integrations/hermes/plugin/ctx_discord_policy/tests/contract/test_ambient_silence.py, integrations/hermes/plugin/ctx_discord_policy/README.md
The event gate sets an unset reply_expected field to False for ambient events when a bot binding exists. Contract tests cover unaddressed ambient messages, addressed messages, and the response-filter contract. The README describes when the bot posts in conversation channels.
Plugin version references
integrations/hermes/plugin/ctx_discord_policy/__init__.py, integrations/hermes/plugin/ctx_discord_policy/dsp/__init__.py, integrations/hermes/plugin/ctx_discord_policy/plugin.yaml, integrations/hermes/plugin/ctx_discord_policy/dsp/web/members.py, integrations/hermes/plugin/ctx_discord_policy/tests/contract/test_dashboard_api.py, integrations/hermes/plugin/ctx_discord_policy/tests/contract/test_two_homes.py, integrations/hermes/plugin/ctx_discord_policy/tests/unit/test_anchor.py, integrations/hermes/plugin/ctx_discord_policy/tests/unit/test_dashboard_routes.py
Version references and corresponding test expectations change from 3.0.1 to 3.0.2. The Discord REST client User-Agent includes the updated version.

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix

Merge Risk: Low · up to 87d99

The change keeps ambient Discord turns silent when the model returns NO_REPLY. Replies to the bot whose target cannot be resolved inside ambient channels may also be treated as ambient and stay silent, which differs from the stated intent that addressed messages keep existing behavior. The impact is narrow and easy to revert, so merge risk is low.

Pre-merge checks: Passed 4

Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title names the fix (ambient-mode turns ending in NO_REPLY stay silent instead of showing Hermes' silence-marker notice), the plugin (ctx_discord_policy), and the version bump (3.0.2). The changes…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title names the fix (ambient-mode turns ending in NO_REPLY stay silent instead of showing Hermes' silence-marker notice), the plugin (ctx_discord_policy), and the version bump (3.0.2). The changeset matches: interventions.py sets reply_expected to False for ambient routes, the version is bumped to 3.0.2 across files, and contract tests cover ambient silence. The title is specific but long (139 characters, 20 words) and includes the version number, so it is less concise than preferred.

Finishing Touches

Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 9646876a-a9fe-4dd6-8e4b-afb137d2a3c0
Commits

Reviewing files that changed from the base of the PR and between e84891b and 87d99a3.

Files selected for processing: 11

  • integrations/hermes/plugin/ctx_discord_policy/README.md
  • integrations/hermes/plugin/ctx_discord_policy/__init__.py
  • integrations/hermes/plugin/ctx_discord_policy/dsp/__init__.py
  • integrations/hermes/plugin/ctx_discord_policy/dsp/adapt/interventions.py
  • integrations/hermes/plugin/ctx_discord_policy/dsp/web/members.py
  • integrations/hermes/plugin/ctx_discord_policy/plugin.yaml
  • integrations/hermes/plugin/ctx_discord_policy/tests/contract/test_ambient_silence.py
  • integrations/hermes/plugin/ctx_discord_policy/tests/contract/test_dashboard_api.py
  • integrations/hermes/plugin/ctx_discord_policy/tests/contract/test_two_homes.py
  • integrations/hermes/plugin/ctx_discord_policy/tests/unit/test_anchor.py
  • integrations/hermes/plugin/ctx_discord_policy/tests/unit/test_dashboard_routes.py

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.

@GottZ
GottZ merged commit 4d8f374 into root Nov 28, 2026
38 of 43 checks passed
@GottZ
GottZ deleted the issue/dspsilence-ambient-turn-may-stay-silent branch November 28, 2026 15:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant