Skip to content

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

Merged
rohitg00 merged 2 commits into
rohitg00:mainfrom
reevesc88:codex/fix-recall-scoped-session-reads-signed
Nov 16, 2026
Merged

rohitg00 merged 2 commits into
rohitg00:mainfrom
reevesc88:codex/fix-recall-scoped-session-reads-signed

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
    • Improved project-filtered search so explicitly project-matched results remain available without requiring a session lookup.
    • Directory-filtered searches continue to exclude results that do not belong to the requested directory. Results without an explicit project still require session ownership checks, and errors during those checks are reported.

Signed-off-by: reevesc88 <calum@ai1auslutions.com>
@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[bot]

This comment was marked as resolved.

@coderabbitai

coderabbitai Bot commented Nov 10, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

mem::search now loads a result’s session only when a cwd filter is active, or when a project filter is active and the memory has no explicit project. Tests cover session-read failures and hybrid refill ranker calls.

Changes: Search filtering

Layer / File(s) Summary
Conditional session lookup
src/functions/search.ts, test/search-project-isolation.test.ts
The search path skips session lookups for explicitly project-matched memories when no cwd filter is active. Tests cover directory filtering, session-store failures, and ranker calls during a failed refill.

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

Change: Bug fix

Possibly related PRs

  • rohitg00/agentmemory#1722: Makes the same session-read change and adds the same session-failure regression tests.
  • rohitg00/agentmemory#1696: Changes hybrid candidate retrieval and enrichment, including the refill path covered by the updated ranker-call assertion.
  • rohitg00/agentmemory#1647: Adds project-ownership filtering and adaptive refill behavior that this change narrows.

Suggested reviewers: rohitg00

Merge Risk: Minimal · up to 2cc47

Scoped recall avoids unnecessary session reads while preserving the established filtering behavior. No actionable merge-blocking risk was identified.

Pre-merge checks: Passed 5

Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title clearly summarizes the main change: skipping unnecessary session reads during scoped recall.
Docstring Coverage Passed No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentat…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Docstring Coverage

Explanation

No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 0 functions across 2 files.

Finishing Touches

Generate unit tests (beta)

  • Create a new PR
  • 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

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 61ac9dd7-e154-44ea-802b-e3d89dddd176
Commits

Reviewing files that changed from the base of the PR and between 28ffc53 and 2cc4739.

Files selected for processing: 2

  • src/functions/search.ts
  • test/search-project-isolation.test.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.

Signed-off-by: reevesc88 <calum@ai1auslutions.com>
@reevesc88

Copy link
Copy Markdown
Contributor Author

Verified final head: 2cc4739. Both commits have Signed-off-by trailers.

  • CI: all eight Linux/macOS and Node 20/22/24/26 jobs passed: https://github.com/rohitg00/agentmemory/actions/runs/42778921474
  • Release gate: all six jobs passed, covering Linux x64/ARM, macOS ARM/Intel, and Windows x64/ARM smoke tests: https://github.com/rohitg00/agentmemory/actions/runs/42778921543
  • Local full suite: 4,774 passed, seven skipped. Build, skills generation/check, docs sync/check, evaluation typecheck and whitespace checks passed. The scoped-session failure was reproduced before correction in all three recall paths.
  • CodeRabbit and Devin status checks are successful. The review finding about the directory-test name is fixed, answered and resolved.

The only remaining failed check is Vercel's preview authorization. Its status explicitly says authorization is required to deploy. The connected account's request to the owning Vercel team returned 403, so a member of rohitg00's Vercel team must authorize this deployment from the Vercel check. The old #1647 CI failures were approval expirations; those historical runs did not execute tests.

No history was rewritten, no source files were deleted, and the superseded unsigned branch remains preserved. #1722 is closed and points to this signed-off replacement. The seven skipped local tests and standalone live-server integration were not executed locally; the hosted release gate exercised its configured live/package checks.

@reevesc88

Copy link
Copy Markdown
Contributor Author

@rohitg00 The code and release checks on head 2cc4739ecce29489c18aecd302d870741d1861a1 are green: all eight CI jobs and all six Release gate jobs passed, CodeRabbit and Devin statuses are successful, and the review thread is resolved.

The only remaining red status is Vercel's contributor authorization. Could a member of the owning Vercel team authorize this preview deployment? The connected account cannot access that team; its team-consent attempt returns “Team not found.” No repository change is needed to clear this gate.

CI: https://github.com/rohitg00/agentmemory/actions/runs/42778921474
Release gate: https://github.com/rohitg00/agentmemory/actions/runs/42778921543

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.

2 participants