hermes - 💡(How to fix) Fix kanban_create tool: missing notifier_profile in auto-subscribe causes notification from wrong gateway bot

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 kanban_create is called from the tool (not the slash command), the auto-subscribe creates a subscription with notifier_profile = NULL. This causes ALL gateway notifiers to attempt delivery of completion/blocked/gave_up events to the subscribed chat, creating a race condition where the wrong Discord/Telegram bot may deliver the notification.

Root Cause

In tools/kanban_tools.py, the kanban_create tool implementation auto-subscribes the originating gateway source but does not pass notifier_profile to kanban_db.add_notify_sub():

https://github.com/NousResearch/hermes-agent/blob/main/tools/kanban_tools.py#L723-L730

kb.add_notify_sub(
    conn,
    task_id=new_tid,
    platform=platform,
    chat_id=chat_id,
    thread_id=thread_id,
    user_id=user_id,
    # missing: notifier_profile
)

While HERMES_PROFILE is already available (used for created_by on line 706), it's not forwarded.

Meanwhile, the slash command path in gateway/run.py does pass it correctly:

https://github.com/NousResearch/hermes-agent/blob/main/gateway/run.py#L9690-L9696

_kb.add_notify_sub(
    conn, task_id=task_id,
    platform=platform_str, chat_id=chat_id,
    thread_id=thread_id or None,
    user_id=user_id,
    notifier_profile=getattr(self, '_kanban_notifier_profile', None) or self._active_profile_name(),
)

Fix Action

Fix / Workaround

  • Hermes Agent v0.15.2 (2026.5.29.2) — present on main branch
  • Multiple Discord gateway profiles running (CEO + Strategist + Teacher)
  • Configured with kanban.dispatch_in_gateway: true and no notification_sources

Code Example

kb.add_notify_sub(
    conn,
    task_id=new_tid,
    platform=platform,
    chat_id=chat_id,
    thread_id=thread_id,
    user_id=user_id,
    # missing: notifier_profile
)

---

_kb.add_notify_sub(
    conn, task_id=task_id,
    platform=platform_str, chat_id=chat_id,
    thread_id=thread_id or None,
    user_id=user_id,
    notifier_profile=getattr(self, '_kanban_notifier_profile', None) or self._active_profile_name(),
)

---

owner_profile = sub.get("notifier_profile") or None
if owner_profile and owner_profile != notifier_profile:
    continue  # skip — not this gateway's subscription

---

kb.add_notify_sub(
    conn,
    task_id=new_tid,
    platform=platform,
    chat_id=chat_id,
    thread_id=thread_id,
    user_id=user_id,
    notifier_profile=os.environ.get(\"HERMES_PROFILE\"),  # <-- fix
)
RAW_BUFFERClick to expand / collapse

Summary

When kanban_create is called from the tool (not the slash command), the auto-subscribe creates a subscription with notifier_profile = NULL. This causes ALL gateway notifiers to attempt delivery of completion/blocked/gave_up events to the subscribed chat, creating a race condition where the wrong Discord/Telegram bot may deliver the notification.

Impact

  • User receives kanban notifications from the wrong gateway bot (e.g., Strategist bot instead of CEO bot on Discord)
  • Confusing UX — the user expects the bot they're talking to (the one that created the task) to deliver updates
  • Pure race condition: whichever gateway polls the kanban DB first wins

Root cause

In tools/kanban_tools.py, the kanban_create tool implementation auto-subscribes the originating gateway source but does not pass notifier_profile to kanban_db.add_notify_sub():

https://github.com/NousResearch/hermes-agent/blob/main/tools/kanban_tools.py#L723-L730

kb.add_notify_sub(
    conn,
    task_id=new_tid,
    platform=platform,
    chat_id=chat_id,
    thread_id=thread_id,
    user_id=user_id,
    # missing: notifier_profile
)

While HERMES_PROFILE is already available (used for created_by on line 706), it's not forwarded.

Meanwhile, the slash command path in gateway/run.py does pass it correctly:

https://github.com/NousResearch/hermes-agent/blob/main/gateway/run.py#L9690-L9696

_kb.add_notify_sub(
    conn, task_id=task_id,
    platform=platform_str, chat_id=chat_id,
    thread_id=thread_id or None,
    user_id=user_id,
    notifier_profile=getattr(self, '_kanban_notifier_profile', None) or self._active_profile_name(),
)

How the bug manifests

In gateway/run.py _kanban_notifier_watcher (lines 4918-4924):

https://github.com/NousResearch/hermes-agent/blob/main/gateway/run.py#L4918-L4924

owner_profile = sub.get("notifier_profile") or None
if owner_profile and owner_profile != notifier_profile:
    continue  # skip — not this gateway's subscription

When notifier_profile is NULL in the DB, owner_profile becomes None, the if condition is falsy, so no gateway skips — all active gateways with a matching platform adapter attempt delivery.

Fix suggestion

Add notifier_profile=os.environ.get(\"HERMES_PROFILE\") to the add_notify_sub call in tools/kanban_tools.py:

kb.add_notify_sub(
    conn,
    task_id=new_tid,
    platform=platform,
    chat_id=chat_id,
    thread_id=thread_id,
    user_id=user_id,
    notifier_profile=os.environ.get(\"HERMES_PROFILE\"),  # <-- fix
)

Environment

  • Hermes Agent v0.15.2 (2026.5.29.2) — present on main branch
  • Multiple Discord gateway profiles running (CEO + Strategist + Teacher)
  • Configured with kanban.dispatch_in_gateway: true and no notification_sources

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