fix(dsh-plugin): pass recallExcludeUris so subtrees can be excluded from recall - #5312
Merged
Merged
Conversation
…rom recall `recall-core.mjs` reads `options.excludeUris` and forwards it as the search request's `exclude_uris`, but the DSH runtime built its recall options without that key, so no configuration could stop a subtree from being recalled. The generated per-directory context files (`viking://user/<space>/skills`, `viking://user/<space>/resources`, `viking://agent/skills`) came back as ordinary hits and carry only boilerplate text — on a vague prompt, 3 of 7 returned entries were these files. The only remedy was deleting the data. Add a `recallExcludeUris` list knob to the shared config schema and pass `cfg.recallExcludeUris` through as `excludeUris` from the DSH recall call, which is the single place that builds those options. The schema entry lands in `memory-plugin-shared/lib` and is propagated to the claude-code and codex copies by `sync.mjs`; those two plugins are marked `committed: true` there because a host installs them from a directory in this repository, so their vendored copies belong in git. `recall-core.mjs` already caps the forwarded list at 200 entries and omits the field entirely when the list is empty, so the default behaviour and the request body are unchanged. Validation, from `examples/dsh-memory-plugin` after `node ../memory-plugin-shared/sync.mjs` and `npm install`: `node --test *.test.mjs` 77 tests, 76 passed, 0 failed, 1 skipped. The new `recallExcludeUris reaches the search request` failed before the change with `exclude_uris` undefined in the request body and passes after it; the companion case asserts no `exclude_uris` field is sent when the knob is unset. `node --check` passes on all three changed source files. `examples/claude-code-memory-plugin` fails 6 tests in `scripts/auto-capture.test.mjs` on this Windows machine. Those tests spawn a real subprocess that talks to a mock server on 127.0.0.1; they fail identically with this change stashed and with a pristine checkout, so they are pre-existing and environmental rather than caused by this change.
ZaynJarvis
approved these changes
Sep 23, 2026
13 of 21 tasks
qin-ctx
pushed a commit
that referenced
this pull request
Sep 28, 2026
* fix(pi): honor recallExcludeUris and recallQueryFilters Both knobs are declared in the shared config schema, and the Claude Code, Codex and DSH plugins apply them, but the pi extension's RecallManager never read either one: - `recallExcludeUris` was not passed as `excludeUris`, so `exclude_uris` never reached the context search and no configuration could keep a URI out of pi's recall (the DSH half of this was fixed in #5312). - `recallQueryFilters` was never compiled or applied, so pi searched with the raw prompt even when the operator configured rules to drop or strip it (acknowledgements, option picks, prefixes). Apply the filters before the length gate, as auto-recall.mjs does, and forward the exclude list to buildRecallBlock. Document both knobs in the pi README. * chore(pi): bump version to 0.4.6
4 tasks done
chaucerj
added a commit
to chaucerj/OpenViking
that referenced
this pull request
Sep 29, 2026
The recallExcludeUris wiring changes entry scripts in both plugins; the plugin-versions gate requires changed plugins to move their version string (same as the DSH volcengine#5312 and pi volcengine#5368 precedents). Co-Authored-By: Claude Code <noreply@anthropic.com>
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.
Description
recall-core.mjsreadsoptions.excludeUrisand forwards it as the search request'sexclude_uris, but the DSH runtime built its recall options without that key, so nothing a user configured could stop a subtree from being recalled.The generated per-directory context files (
viking://user/<space>/skills,viking://user/<space>/resources,viking://agent/skills) are returned as ordinary hits and carry only boilerplate text. On a vague prompt, 3 of 7 returned entries were these directory files. The only current remedy is deleting the data.Before:
excludeUrisappears 0 times inexamples/dsh-memory-plugin/runtime.mjs; the search request body never carriesexclude_uris.After: a
recallExcludeUrislist knob reaches the request asexclude_uris, and the field is omitted entirely when the knob is unset.Human Involvement
Related Issue
Addresses the first of the three defects in #5206 (
excludeUrisis implemented but never passed by the DSH plugin). The other two defects in that issue —recallLimitbelow the category count widening the search, andrecallTokenBudget/recallMaxContentCharsonly affecting the fallback path — are separate changes and are deliberately left out so this stays one coherent fix.Type of Change
Changes Made
examples/memory-plugin-shared/lib/config-schema.mjs: addrecallExcludeUris(type: "list", default[],OPENVIKING_RECALL_EXCLUDE_URIS,capability: "recall"), following the existingrecallQueryFiltersprecedent for list-valued recall knobs.examples/dsh-memory-plugin/runtime.mjs: passexcludeUris: state.config.recallExcludeUrisin the options object built forbuildRecallBlock. This is the single place that builds those options.shared/config-schema.mjscopies underexamples/claude-code-memory-pluginandexamples/codex-memory-pluginare regenerated byexamples/memory-plugin-shared/sync.mjs. Both targets are declaredcommitted: truethere because a host installs those plugins from a directory in this repository, so their copies belong in git;examples/dsh-memory-plugin/shared/iscommitted: falseand gitignored, so it is not part of the diff.No server, SDK, persisted-data, or public API change.
recall-core.mjsalready caps the forwarded list at 200 entries and omitsexclude_uriswhen the list is empty, so the default request body is byte-identical to before.Testing
Validation run on Windows / Node.js v24.18.0, from
examples/dsh-memory-pluginafternode ../memory-plugin-shared/sync.mjsandnpm install:node --test *.test.mjs: 77 tests, 76 passed, 0 failed, 1 skipped. Baseline before this change was 75 tests / 74 passed / 1 skipped, so the two new cases are the only delta.recallExcludeUris reaches the search requestfailed before the source change withexclude_urisreported asundefinedin the captured request body, and passes after it. The companion case asserts noexclude_urisfield is sent when the knob is unset, so the default path is pinned as well.node --checkpasses onruntime.mjs,runtime.test.mjs, andconfig-schema.mjs.Pre-existing failures, verified not to be caused by this change:
examples/claude-code-memory-pluginfails 6 tests inscripts/auto-capture.test.mjson this machine. Those tests spawn a real subprocess that talks to a mock server on127.0.0.1. They fail identically with this change stashed and against a pristine checkout, so they are environmental (Windows subprocess/loopback) rather than related to this diff, which only adds a schema entry that those tests do not read.No live server, live model, or packaged-plugin (
npm pack) run was performed; the recall path was exercised against the plugin's own mock transport.Checklist
Additional Notes
Documentation is unchanged:
recallExcludeUrisis a new optional knob with a safe empty default, and the DSH README does not currently enumerate recall knobs individually, so there is no existing statement to correct. If maintainers would like the knob documented alongside the otherrecall*settings, say so and I will add it in both languages.One design note for review: I scoped this to the DSH plugin only, matching the issue's report.
excludeUrisis read by sharedrecall-core.mjs, so the same gap exists for any other host that builds recall options without the key — but no other plugin in this repository currently reads arecallExcludeUrisconfig value, so wiring only DSH keeps the change minimal rather than speculative.