Repository navigation
feat(memory-lancedb): make auto-recall selectivity configurable - #109283
jgrandguillaume wants to merge 1 commit into
Conversation
aaa7adf to
4c16ecc
Compare
|
Codex review: needs maintainer review before merge. Reviewed July 17, 2026, 3:00 AM ET / 07:00 UTC. Summary PR surface: Source +117, Tests +226, Docs +21. Total +364 across 7 files. Reproducibility: not applicable. This PR adds a new advanced configuration capability rather than repairing behavior already defined as broken by current docs, tests, or API contract. Review metrics: 1 noteworthy metric.
Stored data model Root-cause cluster Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Risk before merge
Maintainer options:
Next step before merge
Maintainer decision needed
Security Review detailsBest possible solution: Have the memory-lancedb owner define the smallest durable contract—preferably user-facing minimum score and result cap with overfetch derived internally, or all three with explicit cross-setting semantics, resource bounds, and aligned docs and tests. Do we have a high-confidence way to reproduce the issue? Not applicable; this PR adds a new advanced configuration capability rather than repairing behavior already defined as broken by current docs, tests, or API contract. Is this the best way to solve the issue? No, not yet: the implementation works, but exposing the internal candidate-pool size independently from direct user policy is not proven to be the narrowest maintainable contract. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against a838c68dbea8. Label changesLabel changes:
Label justifications:
Evidence reviewedPR surface: Source +117, Tests +226, Docs +21. Total +364 across 7 files. View PR surface stats
What I checked:
Likely related people:
What the crustacean ranks mean
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics. How this review workflow works
Review history (4 earlier review cycles)
|
Auto-recall selectivity is hardcoded: minimum similarity 0.3, a candidate overfetch of 10, and an injection cap of 3. Operators cannot tune precision/recall for their own data without editing plugin source. Surface the three knobs as config (recallMinScore, recallResultCap, autoRecallOverfetch) with manifest uiHints and defaults equal to the previous hardcoded values, and thread them through the live-config merge so operator values take effect at the before_prompt_build hook, not only at startup. Behavior-preserving when unset. The two count settings are declared `integer` in the manifest and the runtime parser rejects (rather than silently floors) non-integer values for them, so both validation layers enforce the same contract; a parity test pins manifest and runtime to the same bounds and failure modes. Add a regression test proving configured values survive the live-config merge into auto-recall (an overfetch of 4 and a minScore of 0.85 reach the search instead of silently reparsing as defaults), and document the three settings including the prompt-budget note for elevated caps. Extracted from the scope PR (openclaw#108782) following its review recommendation to split the tuning improvement from the partitioning contract. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
4c16ecc to
248eeec
Compare
|
Addressed both rank-up moves:
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
Addressed the proof rank-up move: the Evidence section now shows this branch executed through the exact requested path — plugin registration, live runtime configuration ( On the config-contract question (all three knobs vs a narrower surface): that is the routed product decision — happy to narrow to @clawsweeper re-review |
|
The re-review request above was not acknowledged — retrying with the alternate command. The live-hook proof is in the updated Evidence section. @clawsweeper re-run |
|
Closing per ClawSweeper review verdict |
What Problem This Solves
Auto-recall selectivity in
memory-lancedbis hardcoded: minimum similarityscore 0.3, candidate overfetch 10, injection cap 3. Operators cannot tune
precision/recall for their own data without editing plugin source.
What This Does
Surfaces the three knobs as plugin config, with manifest
uiHintsand defaultsequal to the previous hardcoded values:
recallMinScore0.3autoRecallOverfetch10recallResultCap3The values are threaded through the live-config merge, so operator settings
take effect at the
before_prompt_buildhook — not only at startup. Behavioris unchanged when unset.
Validation parity (review follow-up): the two count settings are declared
integerin the manifest, and the runtime parser rejects — rather thansilently floors — non-integer values for them, so a config can never validate
in one layer and be reinterpreted by the other. A parity test pins both layers
to the same types, bounds, and failure modes.
recallResultCapraises only theinjected block size when explicitly configured; the docs now carry a
prompt-budget note for elevated caps, and
autoRecallOverfetchnever increasesinjected content (it only widens the internal candidate pool).
Extracted from #108782 following its review's recommendation to split this
tuning improvement from the partitioning contract; the two PRs are independent
(whichever lands second trivially rebases one shared call site).
Evidence
Live-hook proof — this branch run through the full requested path: plugin
registration (config parse) → live runtime configuration
(
api.runtime.config.current(), re-parsed byresolveCurrentHookConfigonevery hook invocation) → the real
before_prompt_buildhandler → theresulting
<relevant-memories>block. No mocks: the real plugin module, anon-disk
@lancedb/lancedbtable populated through the realmemory_storetool, and a local deterministic OpenAI-compatible embedding endpoint serving
real HTTP requests. Each scenario changes only the live config between hook
invocations (a live reload — no restart, no re-registration):
Proof output + reproducible script (drop at repo root,
pnpm exec tsx _proof-live-hook.mts)Automated checks
pnpm test:extension memory-lancedb— 148 tests passing, including:a regression test proving configured values survive the live-config merge
into auto-recall (an overfetch of 4 and a minScore of 0.85 reach the search
instead of being silently dropped and reparsed as defaults once a live
runtime config object is present, which is the normal case); and a
manifest/runtime validation-parity test (fractional counts rejected by
both layers, identical bounds, boundary values preserved verbatim).
tsgoprod + test lanes, the type-aware extensions lint shard, thetype-suppression inventory, and the docs format/map checks are all green.
What To Review
(
extensions/memory-lancedb/config.ts) and the matching manifestintegerconstraints.
resolveCurrentHookConfig— the fix theregression test pins down.
Prepared with AI assistance.