hermes - 💡(How to fix) Fix Proposal: DM-based approval gate for outbound Discord messages

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…

When running Hermes on Discord in public/shared channels, every outbound reply goes live instantly. For some setups (multi-user servers, persona testing, compliance, kid-facing bots, multi-bot conversations where hallucinations are costly) I'd like a human-in-the-loop gate before a message hits the channel.

Root Cause

When running Hermes on Discord in public/shared channels, every outbound reply goes live instantly. For some setups (multi-user servers, persona testing, compliance, kid-facing bots, multi-bot conversations where hallucinations are costly) I'd like a human-in-the-loop gate before a message hits the channel.

RAW_BUFFERClick to expand / collapse

Context

When running Hermes on Discord in public/shared channels, every outbound reply goes live instantly. For some setups (multi-user servers, persona testing, compliance, kid-facing bots, multi-bot conversations where hallucinations are costly) I'd like a human-in-the-loop gate before a message hits the channel.

Proposal

Add an opt-in env flag DISCORD_APPROVAL_USER_ID=<user_id>.

When set, the Discord adapter intercepts outbound send():

  1. Bot DMs the approver user with the proposed reply in an embed
  2. Three buttons: Approve / Edit (opens a discord.ui.Modal) / Deny
  3. Approver decision resolves an asyncio.Future the send() call is awaiting
  4. Approved (or edited) text → posted to the original channel
  5. Denied / timeout (configurable, default 120s) → dropped silently, nothing posted publicly
  6. DMs sent directly to the approver bypass the gate (so they can converse with the bot normally for testing)

Reuses the existing button-View pattern already in ExecApprovalView — no new deps.

Why opt-in via env flag

  • Default = current behavior, zero regression
  • One env var, no config.yaml surgery
  • Turn off = feature fully dormant

Working prototype

I've built this locally and it works well. Single new file (gateway/platforms/discord_approval.py, ~150 lines) + ~25 lines inserted into DiscordAdapter.send(). Happy to open a PR if you're interested.

Questions

  • Is this direction aligned with where you want the Discord adapter to go?
  • Would you prefer it generalized to other platforms (Telegram etc.) before merge, or Discord-only is fine as a first step?
  • Any preferences on config surface (env var vs. config.yaml key vs. per-channel)?

Happy to adjust scope based on feedback.

extent analysis

TL;DR

Implementing an opt-in environment flag DISCORD_APPROVAL_USER_ID to introduce a human-in-the-loop approval gate for outbound replies in Discord channels.

Guidance

  • Review the proposed implementation in gateway/platforms/discord_approval.py and the modifications to DiscordAdapter.send() to understand the changes required for the approval gate.
  • Consider the trade-offs between using an environment variable versus a config.yaml key for configuring the approval feature, taking into account ease of use and flexibility.
  • Evaluate the potential need to generalize this feature to other platforms like Telegram, weighing the benefits of a unified approach against the complexity of supporting multiple platforms.
  • Test the working prototype in various scenarios, including multi-user servers and persona testing, to ensure the approval gate functions as expected.

Example

No code snippet is provided as the issue does not contain explicit code that can be safely referenced or modified.

Notes

The implementation details and the decision on how to configure the approval feature (via environment variable or config.yaml) may impact the ease of use and maintenance of the Discord adapter.

Recommendation

Apply the proposed workaround by implementing the DISCORD_APPROVAL_USER_ID environment flag, as it provides a flexible and non-intrusive way to introduce the approval gate without altering the default behavior of the Discord adapter.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING