Skip to content

Let personas react with any emoji, see the server's emoji, and post embeds in their own channel - #13

Merged
offendingcommit merged 3 commits into
mainfrom
feat/channel-scoped-actions
Nov 8, 2026
Merged

offendingcommit merged 3 commits into
mainfrom
feat/channel-scoped-actions

Conversation

@offendingcommit

@offendingcommit offendingcommit commented Nov 8, 2026 •

Copy link
Copy Markdown
Owner

Before: personas on Discord could only react with Hermes' automatic 👀/✅/❌, had no way to see the server's own emoji, and could not post an embed.

After: a persona can react to the message it is answering (or another message in the same channel) with any emoji or one of the server's own, list the server's emoji palette, and post one embed card in the channel it is replying in.

The channel, server and triggering message come from the Hermes session the gateway binds for the turn (HERMES_SESSION_*), never from model arguments, so a model cannot aim a reaction or embed at another channel.

How

New actions.py with three kit-decorated tools registered into Hermes' own discord toolset:

Tool Does Bot permission
discord_list_emojis This server's usable custom emoji, each with a <:name:id> usage string none beyond being in the server
discord_react One emoji on the triggering message, or message_id in this channel Add Reactions, Read Message History
discord_send_embed One embed in this channel, Discord's limits enforced, mentions suppressed Send Messages, Embed Links

Guards, all before any Discord request:

  • Refuses unless the session platform is discord, and refuses in cron runs.
  • Custom emoji must be in the current server's palette, available, and not role-locked, so Use External Emojis is not needed.
  • A message link naming another channel is refused. The parent channel is tried only for the triggering message, for auto-created threads.
  • Per incoming message: at most 5 reactions and 2 embeds. Refused or failed writes refund the budget.
  • DISCORD_TOOLS_ALLOWED_GUILDS applies to the actions as it does to reads.

Why the discord toolset: Hermes turns unseen plugin toolsets on by default, so a new toolset would have appeared on every profile loading this plugin, Telegram included. discord is a core toolset that a profile gets only when its config names it. In infra that is platform_toolsets.discord in the amber-, beatrice- and daphne-discord overlays from offendingcommit/infra#1652. Merging this alone changes nothing on public bots until that PR merges.

This changes the repo's "must stay read-only" guardrail in AGENTS.md: the read tools stay read-only and these three actions become the whole write surface.

Also in this PR: the README's docs are folded into AGENTS.md (README now just points there), and hermes-plugin-kit moves to latest main, ca9e1c9 (from 90da8eb). That kit commit adds ToolError, reads reserved tool names without importing Hermes, and pins its contract lane to Hermes bf0203a7.

Checks

  • make test: 89 tests, Python 3.13 as in CI, on kit ca9e1c9.
  • With HERMES_AGENT_PATH at the deployed Hermes source (bf0203a7) and at v0.23.0 (2bd378ed), a new layer binds sessions with Hermes' real set_session_vars, follows the scope into tool worker threads, and registers into the real registry: the actions resolve under discord only, never messaging, hermes-telegram, hermes-cli or hermes-api-server.
  • Against the rendered infra configs on the #1652 branch, Hermes' own _get_platform_tools gives the actions on Discord to amber-, beatrice- and daphne-discord only, and to no profile on Telegram.
  • Targeted mutation run on actions.py: 34 of 34 mutants killed.
  • The live client (DiscordLiveActions) is not exercised against Discord; it reuses the existing REST-only login seam.

Generated by Claude Code

…nt channel

Three tools join Hermes' own `discord` toolset:

- discord_list_emojis: this server's usable custom emoji with ready usage strings
- discord_react: any Unicode emoji, or this server's emoji, on the message being
  answered or another message in the same channel
- discord_send_embed: one embed card in this channel, held to Discord's embed
  limits, mentions suppressed

The channel, server and triggering message come from the Hermes session
(HERMES_SESSION_*), never from model arguments. Actions refuse on other
platforms and in cron runs, keep custom emoji to the current server, and spend
from a per-message budget (5 reactions, 2 embeds).

Joining the core `discord` toolset (not `messaging`, not a new plugin toolset)
means only profiles whose config names that toolset see them; Hermes turns
unseen plugin toolsets on by default.

Tests cover the pure pieces directly, the impls against an in-memory client,
embeds round-tripped through discord.py's Embed, and, with HERMES_AGENT_PATH
set, Hermes' real set_session_vars, registry and toolsets.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
README now points to AGENTS.md, which holds the tools, hook, environment,
logging, registration, guardrails and validation notes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Moves from 90da8eb to ca9e1c9, which adds ToolError, reads reserved tool
names without importing Hermes, and pins its contract lane to Hermes
bf0203a7 (the revision this plugin's real-Hermes layer already runs on).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@offendingcommit
offendingcommit marked this pull request as ready for review November 8, 2026 13:22
@offendingcommit
offendingcommit merged commit 4e49ef5 into main Nov 8, 2026
2 checks passed
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.

2 participants