Keep recent memories in context
All checks were successful
Publish Library / Build NPM Project (push) Successful in 53s
Publish Library / Tag Version (push) Successful in 17s

This commit is contained in:
2026-08-01 21:42:05 -04:00
parent 1aa6cdf329
commit 68e72445a2
3 changed files with 132 additions and 114 deletions

View File

@@ -340,7 +340,7 @@ Also relevant but not preloaded (use \`memory_recall\`): ${listed.map(r => r.nam
if(typeof resp === 'string' && !resp.trim() && lastDelegateResp !== null) resp = lastDelegateResp;
// Trim memory injections from history
if(mem?.tool) history.splice(0, history.length, ...history.filter(h => h.role !== 'tool' || h.name !== 'recall'));
if(mem?.tool) history.splice(0, history.length, ...history.filter(h => h.role !== 'tool' || h.name !== 'memory_recall'));
// Auto-memorize before compressing
if(options.compress && this.estimateTokens(history) >= options.compress.max) {