Skip to content

FIX Return no memory results for empty prompt ID filters - #1499

Merged
Roman Lutz (romanlutz) merged 3 commits into
microsoft:mainfrom
biefan:reject-empty-memory-filters
May 2, 2026
Merged

FIX Return no memory results for empty prompt ID filters#1499
Roman Lutz (romanlutz) merged 3 commits into
microsoft:mainfrom
biefan:reject-empty-memory-filters

Conversation

@biefan

Copy link
Copy Markdown
Contributor

Summary

  • return an empty result when prompt_ids=[] is passed to memory queries
  • add regression coverage for both get_message_pieces() and get_prompt_scores()

Problem

MemoryInterface.get_message_pieces() currently uses a truthy check for prompt_ids, so an explicit empty list is treated the same as omitting the filter entirely.

That makes get_message_pieces(prompt_ids=[]) and get_prompt_scores(prompt_ids=[]) fall back to full queries, which is inconsistent with get_scores(score_ids=[]) and surprising for an explicit ID filter.

Testing

  • .venv/bin/pytest tests/unit/memory/memory_interface/test_interface_prompts.py tests/unit/memory/memory_interface/test_interface_scores.py -q

@hannahwestra25 hannahwestra25 self-assigned this Mar 24, 2026
@romanlutz

Roman Lutz (romanlutz) commented Apr 11, 2026

Copy link
Copy Markdown
Contributor

hannahwestra25 when would we ever want this behavior? I'm confused. I think it more likely someone specified the empty list by accident than wanting/expecting an empty list result.

Update: chatted about this separately and it's probably best to keep as is. If a user is doing something wrong this is probably not the place to tell them about it.

@behnam-o
Behnam (behnam-o) force-pushed the reject-empty-memory-filters branch from dd0eec1 to 387752c Compare May 1, 2026 21:06
@romanlutz Roman Lutz (romanlutz) changed the title Return no memory results for empty prompt ID filters FIX Return no memory results for empty prompt ID filters May 2, 2026
@romanlutz
Roman Lutz (romanlutz) added this pull request to the merge queue May 2, 2026
Merged via the queue into microsoft:main with commit 2934127 May 2, 2026
48 checks passed
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.

3 participants