Skip to content

feat(gateway/slack): support channel_skill_bindings - #16283

Merged
teknium1 merged 2 commits into
mainfrom
hermes/hermes-aa28dba4
Apr 27, 2026
Merged

feat(gateway/slack): support channel_skill_bindings#16283
teknium1 merged 2 commits into
mainfrom
hermes/hermes-aa28dba4

Conversation

@teknium1

Copy link
Copy Markdown
Contributor

Port Discord's channel_skill_bindings feature to Slack, sharing a new helper so both adapters stay in sync.

Why

Slack channels/DMs with a dedicated purpose (flashcard DM, support channel, domain-specific Q&A) currently burn a full agent turn on skill selection for every short reply. Discord already has channel_skill_bindings to pre-load a skill at session start; Slack gets parity.

Changes

  • gateway/platforms/base.py: new shared resolve_channel_skills() helper (mirrors the existing resolve_channel_prompt() pattern — same config semantics, same lookup order).
  • gateway/platforms/discord.py: _resolve_channel_skills() now delegates to the shared helper. No behavior change — existing tests still pass.
  • gateway/platforms/slack.py: _handle_slack_message resolves channel_skill_bindings per message and attaches auto_skill to MessageEvent. The gateway's existing auto-skill injection path does the actual session-start skill load.
  • gateway/config.py: channel_skill_bindings is now bridged from slack: in config.yaml (was Discord-only).
  • website/docs/user-guide/messaging/slack.md: new Per-Channel Skill Bindings section.
  • tests/gateway/test_slack_channel_skills.py: 11 new tests covering DM/thread/parent resolution, single-vs-list skill values, dedup, malformed entries, and end-to-end MessageEvent wiring.

Usage

slack:
  channel_skill_bindings:
    - id: "D0ATH9TQ0G6"
      skills: [german-flashcards]
    - id: "C01RESEARCH"
      skills: [arxiv, writing-plans]
    - id: "C02SUPPORT"
      skill: hubspot-on-demand

Validation

tests/gateway/test_slack_channel_skills.py + test_discord_channel_skills.py + test_slack.py + test_slack_mention.py: 203 passed. Discord tests unchanged and passing (delegation is behavior-preserving).

Credits

Closes #13962

mewwts and others added 2 commits April 26, 2026 18:24
Extends the existing channel_skill_bindings mechanism (previously
Discord-only) to Slack, so a channel or DM can auto-load one or more
skills at session start without relying on the model's skill selector
for every short reply.

Motivation: Mats's German flashcards DM pushes a cron-driven card
5x/day; he responds with one-word guesses like 'work'. Previously each
reply required the main agent to decide whether to load german-flashcards
(full opus turn just to pick a skill). With the binding configured per
Slack channel, the skill is injected at session start and grading runs
directly.

Changes:
- Extract resolve_channel_skills() from DiscordAdapter._resolve_channel_skills
  into gateway.platforms.base (now shared across adapters).
- DiscordAdapter._resolve_channel_skills delegates to the shared helper
  (behavior preserved — existing test suite still passes unchanged).
- SlackAdapter: resolve channel_skill_bindings on each message and attach
  auto_skill to MessageEvent. gateway/run.py already handles auto-skill
  injection on new sessions; this just wires Slack through it.
- gateway/config.py: accept channel_skill_bindings in slack: block of
  config.yaml (was Discord-only).
- Tests: new tests/gateway/test_slack_channel_skills.py with 11 cases
  covering DM/thread/parent resolution, single-vs-list skills, dedup,
  malformed entries. Discord suite unchanged.
- Docs: add 'Per-Channel Skill Bindings' section to Slack user guide.

Config example:
  slack:
    channel_skill_bindings:
      - id: "D0ATH9TQ0G6"
        skills: ["german-flashcards"]
@teknium1
teknium1 merged commit 2a0fc97 into main Apr 27, 2026
11 of 12 checks passed
@teknium1
teknium1 deleted the hermes/hermes-aa28dba4 branch April 27, 2026 01:25
@alt-glitch alt-glitch added type/feature New feature or request P2 Medium — degraded but workaround exists platform/slack Slack app adapter comp/gateway Gateway runner, session dispatch, delivery labels Apr 27, 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/feature New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants