← Back to PRs

#10001: fix(memory-lancedb): support partial ID matching in memory_forget

by jeremylancaster open 2026-02-06 00:36 View on GitHub →
extensions: memory-lancedb stale
## Problem The `memory_forget` tool displays truncated IDs when listing memories (e.g. `[36880d07]`) but requires full UUIDs to delete. This creates a frustrating UX where the displayed ID can't be used directly. ## Solution Add prefix matching support, similar to the pattern used in #9641 for exec approvals: - Add `findByIdPrefix()` method to `MemoryDB` class that searches for memories matching a partial ID - When `memoryId` param is < 36 chars, treat it as a prefix and look up the full ID - Also show full IDs in the deletion candidate list for clarity ## Testing Manually verified against local LanceDB instance — partial IDs now successfully resolve and delete the correct memory entries. ## Notes AI-assisted: planned by Kai (Kimi K2.5), implemented by Edwin (Claude Opus 4.5). Happy to address any feedback. <!-- greptile_comment --> <h2>Greptile Overview</h2> <h3>Greptile Summary</h3> - Adds `MemoryDB.findByIdPrefix()` to resolve truncated memory IDs to full IDs during `memory_forget`. - Updates `memory_forget` to accept prefix IDs (< 36 chars), returning explicit not-found / ambiguous-prefix responses. - Changes candidate listing output to show full memory IDs instead of 8-char truncation for easier copy/paste. <h3>Confidence Score: 4/5</h3> - Mostly safe to merge once input validation around prefix IDs is tightened. - Changes are localized to the memory-lancedb tool and add explicit handling for not-found/ambiguous prefixes. Main remaining concern is that prefix mode currently accepts arbitrary short strings, which can bypass the existing UUID-format guard and produce confusing behavior; tightening validation would reduce surprises. - extensions/memory-lancedb/index.ts <!-- greptile_other_comments_section --> **Context used:** - Context from `dashboard` - CLAUDE.md ([source](https://app.greptile.com/review/custom-context?memory=fd949e91-5c3a-4ab5-90a1-cbe184fd6ce8)) - Context from `dashboard` - AGENTS.md ([source](https://app.greptile.com/review/custom-context?memory=0d0c8278-ef8e-4d6c-ab21-f5527e322f13)) <!-- /greptile_comment -->

Most Similar PRs