Memory tidy: surface dropped ops and dedupe duplicate adds in the index
Maintainers usually reply within 1 day
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 25/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- typescript
- Domain
- ai
Research direction
Start in src/shared/memoryIndex.ts: validateOps silently discards malformed ops and applyOps adds duplicates. Run the repro script in the issue through test/load-ts.cjs to see the current counts. Open PR #353 already targets this, so check it before writing code. Done means dropped ops are counted by reason and deduped adds are skipped and counted, both visible in the tidy result and the memory-tidy log event.
Written by the indexing model from the issue text.
Description
What happened?
The background memory tidy-up asks a Haiku model for itemised ops (add/update/delete/procedure) against each agent's memory index. Two failures on the app side make the index drift and hide model quality:
-
validateOps(src/shared/memoryIndex.ts) drops malformed ops unknown ops, unknown ids, bad kinds, missing text with no count and no log line. Thememory-tidyevent in the hive log reports added/updated/deleted, so a tidy run that discarded half the model's reply is indistinguishable from a clean one. Expected: the number of dropped ops (per reason) visible in the tidy result and thememory-tidylog event. -
applyOpshas no dedup on add. If the model returns the same fact twice in one response or under different casing both become index entries. Expected: a normalized-text duplicate add is skipped and counted, keeping one entry against the fixed 2000-token index budget.
Steps to reproduce
-
Clone the repo at main (c7a191ad), run
npm install. -
From the repo root, run the following with Node 22 (no Claude CLI needed):
node -e "
const mi = require('./test/load-ts.cjs')('src/shared/memoryIndex.ts');
const e=(id,kind,text,source='task',date='2026-09-01',expires)=>({id,kind,text,source,date,...(expires?{expires}:{})});
const entries=[e('m1','fact','Supplier cutoff is Thursday noon','task','2026-09-01','2026-10-01')];
console.log('5 ops in ->', JSON.stringify(mi.validateOps({ops:[
{op:'add',kind:'fact',text:'Weekly payroll runs Friday',source:'task'},
{op:'add',kind:'secret',text:'bad kind'},
{op:'update',id:'m99',text:'unknown id'},
{op:'rewrite',text:'unknown op'},
{op:'add',kind:'fact',text:''}]}, entries)));
const out = mi.applyOps(entries,[
{op:'add',kind:'fact',text:'Weekly payroll runs Friday',source:'task'},
{op:'add',kind:'fact',text:'weekly payroll runs friday',source:'task'},
{op:'add',kind:'fact',text:'Weekly payroll runs Friday',source:'task'}],'2026-10-13');
console.log('stats ->', out.stats);
out.entries.forEach(x=>console.log(' ', mi.entryLine(x)));
" -
First block: 5 ops in, 1 valid op out; 4 dropped ops are invisible (no count anywhere).
-
Second block: the same fact lands three times (m2/m3/m4) and stats report added:3.
Screenshot or screen recording
Logs / stack trace
5 ops in -> [{"op":"add","kind":"fact","text":"Weekly payroll runs Friday","source":"task"}]
stats -> {"added":3,"updated":0,"deleted":0,"procedures":0,"repeats":0}
- [m1] fact | Supplier cutoff is Thursday noon | task | 2026-09-01 | expires 2026-10-01
- [m2] fact | Weekly payroll runs Friday | task | 2026-10-13
- [m3] fact | weekly payroll runs friday | task | 2026-10-13
- [m4] fact | Weekly payroll runs Friday | task | 2026-10-13
Operating system
Linux
OS version
Ubuntu 24.04 (WSL2)
Don't Be Michael version
0.1.9
Node version
v22.23.3
Agent CLI and version (if relevant)
n/a repro is pure functions, no agent CLI
Pre-flight
- I attached a screenshot or recording above.
- I'm on the latest release, or I've said above why I can't be.
- I re-ran
npm installsonode-ptyis rebuilt for the current Electron ABI (source installs only). - I searched existing issues and this isn't a duplicate.
- Dominant language
- TypeScript
- Stars
- 273
- Forks
- 211
- Avg merge
- 14h 24m
- Merged PRs (30d)
- 203
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from agentvivekkumar/dontbemichael
-
Windows: a hidden Claude call cannot start when the CLI path has a spacePossibly taken @theshloksschauhan claimed this 2 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
agentvivekkumar/dontbemichael#426 ·
Maintainers usually reply within 1 day
-
Raise Home and Manager setup text to the 14px floorPossibly taken @glenmiracle18 claimed this 2 days ago. Openbug os:windows
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
agentvivekkumar/dontbemichael#416 · 1 comment ·
Maintainers usually reply within 1 day
-
enhancement
Difficulty 5/5 Over a week Newbie friendliness 15/100
agentvivekkumar/dontbemichael#499 ·
Maintainers usually reply within 1 day
-
Enhancement: read scans and photos on Windows with the OCR built into Windows, as the Mac already doesPossibly taken @MickyG03 claimed this today. Openenhancement
Difficulty 3/5 1-2 days Newbie friendliness 28/100
agentvivekkumar/dontbemichael#498 · 1 comment ·
Maintainers usually reply within 1 day
-
enhancement
Difficulty 5/5 Over a week Newbie friendliness 22/100
agentvivekkumar/dontbemichael#490 ·
Maintainers usually reply within 1 day
All issues in agentvivekkumar/dontbemichael
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 73/100
anomalyco/opencode#56380 · 1 comment ·
Maintainers usually reply within 1 day
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
BUG | `MCP 服务器` | 全局层行的停用/启用与删除报 404 server row not found,编辑保存会在 profile 层复制出重复行Possibly taken @w6242652 claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Chocobozzz/PeerTube#7832 ·
Maintainers usually reply within 3 days
-
Pay to use?Open
Difficulty 1/5 Under an hour Newbie friendliness 66/100
darkreader/darkreader#16108 · 1 comment ·
Maintainers usually reply within 2 days