Repository navigation
fix(memory): honor configured primary search result limits - #133254
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: needs maintainer review before merge. Reviewed August 30, 2026, 6:34 AM ET / 10:34 UTC. ClawSweeper reviewWhat this changesThe PR makes primary-only memory searches use the configured result limit when a tool call omits its own limit, while retaining the ten-result budget for wiki and combined searches. Regression provenancePossible regression — probable (reviewed change; failure trace). No predecessor PR is attributed. Merge readinessThe patch is a coherent repair for the linked configured-budget bug and has no actionable introduced defect in this review. This PR remains open for maintainer handling because it carries the protected Priority: P2 Review scores
Verification
How this fits togetherMemory Core turns indexed memory and optional wiki matches into the model-visible flowchart LR
A[Memory search configuration] --> B[Memory Core tool]
C[Primary memory matches] --> B
D[Optional wiki matches] --> B
B --> E{Requested corpus}
E --> F[Primary results]
E --> G[Combined result budget]
F --> H[Model-visible JSON]
G --> H
Before merge
Agent review detailsSecurityNone. PR surfaceSource 0, Tests +111, Docs +5. Total +116 across 5 files. View PR surface stats
Review metrics
Stored data modelPersistent data-model change detected: Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Technical reviewBest possible solution: Merge the canonical primary-only budget repair after the normal protected-label maintainer review, retaining the separate wiki and combined-search budget behavior. Do we have a high-confidence way to reproduce the issue? Yes. Current main applies a configured primary limit and then unconditionally applies a separate omitted-parameter ten-result merge cap; the PR's added tool-level table targets that deterministic path. Is this the best way to solve the issue? Yes. The branch removes the second cap only for primary-only searches and preserves the established aggregation path for wiki and combined searches. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against d498334714d2. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (1 earlier review cycle)
|
|
Land-ready proof for The latest ClawSweeper review found no actionable patch defect. Its current-main/release source gap is resolved: direct comparison of the entire Memory Core plugin, primary config owner, and affected docs against current main Local commands, with isolated temporary state and one test worker: The full changed gate passed. Proof exercises real tool execution and model-visible JSON with the existing synthetic manager seam; no live provider/model, database, or index run is claimed. The separate, source-only combined-search recall-tracking observation is documented as a follow-up and its persistence behavior is intentionally unchanged. Native review artifacts are validated; landing will use the repository's prepare/merge wrapper. |
|
Merged via squash.
|
Closes #133253
What Problem This Solves
Fixes an issue where operators who raised
memory.search.query.maxResultsabove ten still received only ten primary-memory search hits when the model omitted a per-call limit. For example, a configured limit of 12 produced 12 eligible hits but serialized only ten to the model, with no truncation warning.Why This Change Was Made
Primary search already owns ranking, visibility filtering, and the configured result window. Return those results directly instead of passing them through the wiki aggregation cap. Reuse settings from the current tool context and remove unused raw-result copies; live configuration refresh and revocation remain unchanged.
Wiki and combined searches keep their independent ten-result default, explicit overrides, balancing, and backfill. This does not change configuration schemas, index/storage behavior, provider calls, or recall persistence. Production LOC: +22/-22 (net 0); regression tests: +111.
User Impact
Primary
memory_searchcalls now honor the configured result limit without requiring the model to repeat it. Existing defaults and explicit limits remain intact. The configuration reference now explains the separate primary and aggregate budgets.Evidence
OPENCLAW_VITEST_MAX_WORKERS=1 node scripts/run-vitest.mjs extensions/memory-core/src/tools.budget.test.ts; the same wrapper forextensions/memory-core/src/tools.test.ts, andextensions/memory-core/src/tools.citations.test.ts -t "revokes retained memory tools".node scripts/check-changed.mjs -- <changed files>gate passed: production/test type checks, scoped lint with zero warnings/errors, formatting, shared plugin-contract tests, and repository guards. Fresh Codex autoreview found no actionable P0 issue; an independent source/artifact review found no actionable finding.v2026.7.1source contains the same unconditional aggregate cap. The owner history distinguishes the primary window from the intentional wiki/all aggregation behavior.Known follow-up, unchanged here: combined searches queue primary recall tracking before final corpus selection, so tracked hits may exceed surfaced hits. This is a source-level observation, not a verified persistence defect; changing that behavior requires separate review.
Maintainer review follow-through: exact-head CI is green for
d0f764cfcd22ab704e64e397763b8986c194d878. The current-main/release inspection gap in the ClawSweeper review is resolved by direct source inspection:extensions/memory-core, the primary configuration owner, and this documentation page are unchanged between the reproduction base and current maind498334714d255a992232f8175be1065fde11627. Stable v2026.7.1 source also applies the unconditional ten-result aggregation cap; this is source evidence, not a live test of that release.The automated stored-data classification is not a material data-model change: this diff changes only transient tool context and result projection. It does not change embedding metadata, schemas, indexes, stored records, or recall-write arguments. The removed
rawResultsfields were unused copies in the transient aggregation value; the actual raw results supplied to recall tracking remain intact. No migration or new persistence behavior is introduced.