Repository navigation
fix(recall): scope hook deduplication to the host run - #1019
Merged
rwmjhb merged 1 commit intoNov 7, 2026
Merged
Conversation
rwmjhb
approved these changes
Nov 7, 2026
rwmjhb
left a comment
Collaborator
There was a problem hiding this comment.
Reviewed ebc8198 through the orchestrator. Approved: adding run identity to the structured dedup key addresses identical prompts in separate runs while preserving duplicate suppression within a run. Targeted and full-suite verification passed.
Integration follow-up: confirm that supported hosts populate ctx.runId consistently across duplicate dispatches and change it between independent runs. When runId is absent, identical timestamp-free events still share a key; the synthetic regression does not establish the real-host contract. Automated build verification was skipped.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
An identical user prompt in the same session can skip auto-recall on a later host run.
before_prompt_buildcarries session and run identity inctx, without an event timestamp. The existing fallback key retains the session and prompt but ignoresctx.runId, so the later request exits before retrieval can see new or changed memories.This is a focused follow-up to the non-blocking repeated-prompt/run-identity finding recorded on merged PR #919.
Change
Include the host run ID in the structured dedup key, and reuse the existing
sha256Hexhelper for prompt-derived identity instead of retaining full prompt text in the Set. Duplicate handlers within one run still collapse; changed prompts in the same run still reach retrieval. Regeneratedist/index.jsfrom the source.Legacy callers without a run ID retain the prior session/event fallback. This patch does not introduce a result cache or claim to distinguish requests when the host supplies no stable invocation identity. The separate per-memory repetition policy remains unchanged.
Validation
c0e2c7a3a8b5780b6133ddfd9e2f426bf0ea1b6c, the registered-hook regression suite has four passing controls and one failure: the second run receives no memory context. The new case uses the validautoRecallMinRepeated: 1setting to keep the unrelated repetition window from confounding the assertion.npm run buildandgit diff --checkpass. A fresh independent P0–P2 review of the source, regenerated dist and regression completedscoped-cleanwith no actionable findings.These tests invoke the actual registered plugin hooks with synthetic retrieval/embedding dependencies. They do not claim real Gateway, provider, channel or natural-conversation acceptance. No stored-data migration or configuration change is required.