Skip to content

fix(openclaw): wire recallExcludeUris into auto-recall - #6865

Open
ydflow wants to merge 1 commit into
volcengine:mainfrom
ydflow:fix/openclaw-recall-exclude-uris
Open

ydflow wants to merge 1 commit into
volcengine:mainfrom
ydflow:fix/openclaw-recall-exclude-uris

Conversation

@ydflow

@ydflow ydflow commented Nov 1, 2026

Copy link
Copy Markdown
Contributor

Problem

recallExcludeUris (env OPENVIKING_RECALL_EXCLUDE_URIS) is declared in the shared config schema for every harness, and the shared recall core forwards it to the context search as exclude_uris (with the 200-entry cap). The claude-code and codex plugins (#5436), dsh (#5312), pi (#5368) and opencode (#6850) all pass it — the openclaw plugin does not.

openclaw even vendors the shared core at examples/openclaw-plugin/shared/recall-core.mjs, whose buildContextSearchBody already accepts options.excludeUris, but nothing reaches it: memoryOpenVikingConfigSchema rejects the key as unknown, SearchContextOptions has no excludeUris field, and buildAutoRecallContext builds its searchContext options without it. A configured exclusion is silently ignored, so generated directory files (viking://user/<space>/skills, viking://user/<space>/resources, viking://agent/skills) keep matching like ordinary content and consume the per-turn recall budget with boilerplate.

Fix

Wire the option through the same layers as the other harnesses:

  • config.ts: accept recallExcludeUris (string or list), normalize to a deduped string[] (default []), allow the key in the schema, expose it in the config spec.
  • client.ts: add excludeUris?: string[] to SearchContextOptions and pass it to buildContextSearchBody, which merges body.exclude_uris (cap included).
  • auto-recall.ts: pass the parsed list from buildAutoRecallContext.
  • README/README_CN: document the option next to recallTargetTypes.

No shared-core changes: the vendored copy already implements the contract.

Tests

  • tests/ut/config.test.ts: string / array / newline forms, dedupe, default [].
  • tests/ut/client.test.ts: exclude_uris lands on the request body; omitted when unset.
  • tests/ut/build-memory-lines.test.ts: end-to-end — configured recallExcludeUris reaches the context search call.

tsc --noEmit clean; full vitest suite green (44 files, 829 tests).

Notes

The shared config schema declares recallExcludeUris (env
OPENVIKING_RECALL_EXCLUDE_URIS) for every harness, and the shared
recall core forwards it to the context search as exclude_uris. The
claude-code, codex, dsh (volcengine#5312), pi (volcengine#5368) and opencode (volcengine#6850)
plugins all pass it; the openclaw plugin declares the option in its
vendored shared/recall-core.mjs but never accepts it in config.ts,
never exposes it in the client SearchContextOptions, and never sends
it from buildAutoRecallContext. A configured exclusion is silently
ignored, so generated directory files (viking://user/<space>/skills,
viking://user/<space>/resources, viking://agent/skills) keep matching
like ordinary content and consume the per-turn recall budget with
boilerplate.

Wire it through the same layers as the other harnesses: parse
recallExcludeUris from workspace config (string or list, deduped,
default []), accept excludeUris on OpenVikingClient.searchContext and
merge it into the request body via the shared buildContextSearchBody
(which applies the 200-entry cap), and pass the parsed list from
buildAutoRecallContext. Document the option in both READMEs.

Tests: config normalization (array/comma+newline string/dedupe/
default), client body forwarding and omission, and an end-to-end
buildAutoRecallContext assertion that the configured list reaches the
context search.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agent-plugins Agent harness and plugin integrations

Projects

Status: Backlog

Development

Successfully merging this pull request may close these issues.

2 participants