Skip to content

fix: skip unnecessary session reads for scoped recall - #1722

Closed
reevesc88 wants to merge 1 commit into
rohitg00:mainfrom
reevesc88:codex/fix-recall-scoped-session-reads
Closed

reevesc88 wants to merge 1 commit into
rohitg00:mainfrom
reevesc88:codex/fix-recall-scoped-session-reads

Conversation

@reevesc88

@reevesc88 reevesc88 commented Nov 10, 2026 •

Copy link
Copy Markdown
Contributor

A project-filtered recall currently reads the session store even when a durable memory already carries the matching project. If that unnecessary read fails, recall rejects instead of returning the matching memory.

Read session metadata only when a directory filter needs it or project ownership must be established through the session. Preserve directory matching and fail-closed legacy ownership checks. Also assert that the failed-refill regression actually calls the ranker twice.

Addresses both follow-ups in #1647 (review). The original PR is already merged; this is a separate, small follow-up based on current main.

Validation:

  • Before the production fix, the new regression failed in keyword, hybrid and hybrid fallback paths: 3 failed, 65 passed.
  • After the fix, 97 focused isolation/hybrid/layer tests passed.
  • Full suite: 4,774 passed, seven skipped.
  • Build, skills generation/check, docs sync/check, evaluation typecheck and whitespace checks passed. No generated changes.
  • Dependency audit: nine moderate findings, zero high/critical; no dependency changes.

The live-server integration test and seven skipped tests were not run. Both historical Actions failures on #1647 were approval expirations, not executed test failures: GitHub reports that the workflow required approval but expired first. Rerun attempts require upstream repository admin rights. A maintainer may need to approve hosted checks on this follow-up too.

Summary by CodeRabbit

  • Bug Fixes
    • Project-filtered search results can remain available when session details cannot be loaded, provided the memory is explicitly associated with the project.
    • Directory-filtered searches continue to verify session details, and memories without an explicit project still require session ownership.

@vercel

vercel Bot commented Nov 10, 2026

Copy link
Copy Markdown

@reevesc88 is attempting to deploy a commit to the rohitg00's projects Team on Vercel.

A member of the Team first needs to authorize it.

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Devin Review found 1 potential issue.

Devin Review

Comment thread src/functions/search.ts Resolved
@coderabbitai

coderabbitai Bot commented Nov 10, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

Caution

Review failed

The pull request is closed.

Walkthrough

Search now skips session lookup for project-matched memories when no directory filter is active. Tests cover this behavior, directory-filtered recall, memories without an explicit project, and hybrid refill ranking.

Changes: Search filtering

Layer / File(s) Summary
Filter-aware session lookup
src/functions/search.ts, test/search-project-isolation.test.ts
Search reads a session for directory filtering or when a project-filtered memory has no explicit project. Tests check recall when session reads fail, directory-based exclusion, ownership checks for memories without an explicit project, and a second ranker call after a refill failure.

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix

Suggested reviewers: rohitg00

Merge Risk: Minimal · up to 5633b

Project-scoped recall avoids unnecessary session reads while retaining legacy ownership checks. No merge-blocking risk was identified.

- [ ] Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

Share

@reevesc88

Copy link
Copy Markdown
Contributor Author

Addressed by replacement PR #1723, signed-off commit 2859ef5. Its source tree is identical to 5633bdd (verified with git diff --exit-code), and the full checks pass: 4,774 tests passed, seven skipped, plus build, skills/docs checks and typecheck. The original commit and branch are preserved. This PR is superseded; no history was rewritten or force-pushed.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant