Problem
apps/desktop/src/main/agent-history/store.ts L78
export function saveStore(store: HistoryStore): void {
writeFileSync(INDEX_TMP, JSON.stringify(store, null, 2), 'utf8'); // pretty-print
...
}
After every history refresh, the entire history index is serialized with 2-space indentation and written to disk. For hundreds of history entries, pretty-printing inflates file size by 30–50%, increases write time (more bytes), and holds a larger string in memory.
Suggested fix
Use JSON.stringify(store) (no indentation). The history index is machine-read; human readability is not a requirement. Any null, 2 occurrences in settings-store.ts writes should be fixed the same way.
Problem
apps/desktop/src/main/agent-history/store.tsL78After every history refresh, the entire history index is serialized with 2-space indentation and written to disk. For hundreds of history entries, pretty-printing inflates file size by 30–50%, increases write time (more bytes), and holds a larger string in memory.
Suggested fix
Use
JSON.stringify(store)(no indentation). The history index is machine-read; human readability is not a requirement. Anynull, 2occurrences insettings-store.tswrites should be fixed the same way.