pi-memory
pi-memory copied to clipboard
fix: projectSlug returns username for home directory paths
Problem
projectSlug() in injector.ts:266 skips 'workplace', 'local', 'home', 'src', 'scratch' but not the username. For /local/home/samfp, it returns 'samfp' — then searchSemantic('samfp', 5) runs on every injection, wasting a query.
Fix
Add the current username to the skip set:
const skip = new Set(['workplace', 'local', 'home', 'src', 'scratch', os.userInfo().name]);
Or better: return empty string if the path is just the home directory (no project-specific segment found).