Repository navigation
feat(plugin): bounded grouped recall packing for #318-lite - #325
Merged
Merged
Conversation
This was referenced Mar 11, 2026
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.
What this does
Implements a surgically small #318-lite recall packing layer in the OpenClaw plugin:
project/file/sectionProblem / Context
Issue: #318
After #319 Slice A, recall became budget-governed and deterministic, but still packed one raw item per hit. That can over-fragment context when multiple hits come from the same source section.
Q’s direction for #318-lite was to steal the useful pattern only (group/collapse/provenance/budget) without introducing full summary storage or architecture expansion.
How it works
1) Grouped packing (project/file/section)
plugin/recall.tsnow groups deduped recall hits by:source_filepath root)source_filesource_section2) Provenance-safe same-source collapse
For each group:
packed_hitspacked_memory_idsNo persistent summary store. No synthetic long-lived node storage.
3) Prompt-budget-aware selection (existing surface reused)
Recall still uses the current path:
before_agent_start-> search -> dedupe ->buildRecallPlan->prependContextBut plan selection now operates on packed groups instead of raw single hits, while preserving:
recallLimitrecallBudgetChars4) Observability
Manifest now reports:
raw_countdeduped_countpacked_countcollapsed_hitsPlugin logs now explicitly show raw/deduped/packed and budget usage before injection.
Files changed
plugin/recall.tsplugin/recall.test.tsplugin/index.tsplugin/README.mdTesting done
Exact commands run:
node --check plugin/index.tsnode --check plugin/recall.tsnode --test plugin/*.test.tsgo test ./...Screenshots / before-after
Terminal/log behavior change:
packed,collapsed_hits) and inject packed recall entriesBreaking changes / risks
Breaking changes: None.
Risk note:
Explicit out-of-scope (enforced)
Merge notes