Fix smart-search durable expansion and project scoping#1091
Conversation
Signed-off-by: Erik Bogado <erikbogado@gmail.com>
|
@ErikBPF is attempting to deploy a commit to the rohitg00's projects Team on Vercel. A member of the Team first needs to authorize it. |
📝 WalkthroughWalkthrough
ChangesSmart-search project scoping
Estimated code review effort: 3 (Moderate) | ~20 minutes Sequence Diagram(s)sequenceDiagram
participant Client
participant SmartSearch
participant KVmemories
Client->>SmartSearch: request expandIds
SmartSearch->>KVmemories: load durable Memory
KVmemories-->>SmartSearch: return Memory
SmartSearch->>SmartSearch: convert with memoryToObservation
SmartSearch-->>Client: filtered expanded observation
Possibly related issues
Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@test/smart-search.test.ts`:
- Around line 166-168: Remove the duplicate results property from the type
assertion in test/smart-search.test.ts at lines 166-168, and remove the
duplicated type-assertion lines at lines 197 and 226. Leave one valid
declaration/assertion at each site so the test file compiles.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 647ceae8-2529-40e8-9236-0b433b90a10f
📒 Files selected for processing (3)
src/functions/smart-search.tssrc/state/memory-utils.tstest/smart-search.test.ts
Fix smart-search durable expansion and project scoping
Summary
mem_*records throughsmart-search.expandIdsprojecton compact and expanded resultsWhy
Smart search can return compact durable-memory hits, but expansion only scans
session observations. Its
projectargument is also forwarded to lesson recallwithout consistently scoping hybrid or expanded results.
This makes compact-to-expanded recall work for durable memories while keeping
project and agent isolation fail-closed.
Fixes #1080.
Validation
npx vitest run test/smart-search.test.ts: 17 passednpm run build: passednpm run skills:check: 15 skills passednpm testunder Node 20: 1,419 passednpm testunder Node 22: 1,419 passednpm run test:integration: 17 passedgit diff --check main...HEAD: passedReview notes
Summary by CodeRabbit
New Features
Bug Fixes