Hermes plugin: auto-recall fires on synthetic process and async-delegation notification turns

Open
#7,272 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

This issue has not been assessed yet.

Description

integration:hermes
Bug Description

In hindsight-integrations/hermes/__init__.py, auto-recall (prefetch() and queue_prefetch()) runs on synthetic user-role turns that Hermes itself injects for background process completions, watch matches, watch overflow/disabled notices, heartbeats, and async subagent delegation results (rendered by Hermes agent/completion_notices/rendering.py).

This is the same class of issue previously fixed for cron notices via recall_cron (#6145): the turn text is a process log or subagent completion wrapper rather than a user question, so auto-recall queries the bank with log/status text and injects unrelated memories into every notification turn.

Steps to Reproduce
  1. Configure the Hermes Hindsight plugin (v2.0.0) with auto_recall: true (and optionally recall_additional_banks).
  2. Run a Hermes session that dispatches background shell processes or async subagent delegations.
  3. Observe incoming recall requests to the Hindsight API when Hermes injects turns rendered by agent/completion_notices/rendering.py, such as:
    • [IMPORTANT: Background process <id> completed normally (exit code 0).\nCommand: ...]
    • [IMPORTANT: <N> background processes completed. Treat these results as one batch and give one consolidated response; preserve failures and actionable results.]
    • [IMPORTANT: Background process <id> matched watch pattern "...".\n...]
    • [IMPORTANT: Watch patterns disabled for process <id> ...] / [IMPORTANT: Watch-pattern overflow: ...] / [IMPORTANT: Watch-pattern notifications resumed. ...]
    • [Background process <id> heartbeat #<N> ...]
    • [ASYNC DELEGATION BATCH COMPLETE — <id>] / [ASYNC DELEGATION TASK FAILED — <id>, ...] / [ASYNC DELEGATION COMPLETE — <id>]
Expected Behavior

Auto-recall should skip Hermes-generated synthetic notification turns by default (similar to recall_cron, ideally with an opt-out setting such as recall_skip_synthetic_turns: true), while:

  • Leaving explicit hindsight_recall tool calls unaffected.
  • Continuing to run auto-recall on real human prompts (including prompts that start with similar words, e.g. [IMPORTANT: Background process monitoring] ... or [IMPORTANT: 2 background processes completed. Which one should I check?]) and webhook/alert prompts (e.g. [FIRING:1] ...).
  • In async prefetch mode, preserving any warmed prefetch from the previous real turn without overwriting or bumping its generation on a notification turn.
Actual Behavior

Every synthetic notification turn triggers full auto-recall across the primary bank and every configured recall_additional_banks. In workflows with frequent background commands and subagent delegations, roughly 75-80% of all auto-recall calls come from these notification turns, adding server load and injecting thousands of characters of unrelated memory context per notice.

Version

Hermes plugin 2.0.0 (0aca9f80ec87 / v1.3.1), Hermes Agent v0.23.6, Hindsight API v1.3.1

LLM Provider

OpenAI


Suggested fix notes

If Hermes exposes turn-origin / display_kind provenance to memory provider hooks in the future, checking provenance directly would be the cleanest signal. Within the current text-only prefetch(query) / queue_prefetch(query) hook signature, checking an anchored matcher against the exact templates in Hermes agent/completion_notices/rendering.py (plus the legacy unbracketed delegation strings in Hermes timeline.py) in both prefetch() and queue_prefetch() cleanly avoids false positives on human-authored prompts while catching all process, watch-control, heartbeat, and delegation notices.

Dominant language
Python
Stars
45.2k
Forks
5.9k
PR merge metrics
No merged PRs in 30d

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from vectorize-io/hindsight

All issues in vectorize-io/hindsight

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.