pi-memory icon indicating copy to clipboard operation
pi-memory copied to clipboard

fix: projectSlug returns username for home directory paths

Open samfoy opened this issue 6 months ago • 0 comments

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).

samfoy avatar May 07 '26 20:05 samfoy