You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit b1ae4e5
Browse filesBrowse the repository at this point in the historyBrowse files
fix(memory): forget removes only what the person's words ask to remove, and says when it could not
Two review findings in forgetNoteTool:
- It checked `said` against itself, which only proves the words were typed. With the goal "fix the
failing date test" quoted as `said`, any query the model chose ("pnpm") removed the person's
package-manager preference. Now sessionMemory.asksToForget requires the quote to be typed this
run, to ask for something to go ("forget", not "don't forget"; "remove"/"delete" only beside
memory/note/rule/preference, so "remove the pnpm lockfile" is not a request; "no longer true",
"outdated"), and to name the memory the model picked: a word of its text, or of a credited note's
quote, other than words every memory shares. Otherwise nothing is removed, and the agent is told
which memory came closest and that the person can use Forget in the Memory tab.
- It ignored factAction's result. On a store that refused the write it still answered `removed`,
and the agent posted "forgot" while the memory stayed in effect. Now that is reported as an error.
// Memory the person asks for (docs/levelcode-sessions-memory.md §12). The host decides whether a note can be
178
178
// credited to the person (sessionMemory.groundNote); the agent only proposes it, with their words.
179
179
constREMEMBER_TOOL={name: 'remember',description: 'Save something the user told you, so future sessions in THIS project start knowing it. Use it when the user asks you to remember something; when they correct how you work ("no, use pnpm", "don\'t mock the database") or confirm an approach that was not obvious ("yes, keep doing that"); when they state a decision or constraint (write dates as absolute dates); or when they say where something lives (a dashboard, a ticket tracker, a doc). Do NOT save what the code or git history already shows, or details of the current task. `said` MUST be the user\'s own words, copied exactly from their message — the note is credited to them only when those words are found in what they typed and the note uses only those words, in their order, keeping every not/never; otherwise it is kept unconfirmed until they confirm it. Keep `text` short and close to their words.',input_schema: {type: 'object',properties: {kind: {type: 'string',enum: ['preference','project','reference'],description: 'preference = how the user wants you to work (corrections and confirmed approaches); project = a decision, constraint or deadline; reference = where to find something outside the code'},text: {type: 'string',description: 'the note, one sentence, in the user\'s terms, e.g. "Use pnpm, never npm, in this repo"'},said: {type: 'string',description: 'the user\'s exact words this note rests on, copied from their message'}},required: ['kind','text','said']}};
180
-
constFORGET_TOOL={name: 'forget',description: 'Remove a note or fact from this project\'s memory when the user asks you to forget it or says it is no longer true. `said` MUST be the user\'s own words asking for it, copied exactly. Removes the best match for `query` and tells you what it removed.',input_schema: {type: 'object',properties: {query: {type: 'string',description: 'words that identify the memory, e.g. "pnpm"'},said: {type: 'string',description: 'the user\'s exact words asking you to forget it'}},required: ['query','said']}};
180
+
constFORGET_TOOL={name: 'forget',description: 'Remove a note or fact from this project\'s memory when the user asks you to forget it or says it is no longer true. `said` MUST be the user\'s own words asking for it, copied exactly, and those words must name what to forget. Removes the best match for `query` only when the user\'s words ask for it to go and name it, and tells you what it removed.',input_schema: {type: 'object',properties: {query: {type: 'string',description: 'words that identify the memory, e.g. "pnpm"'},said: {type: 'string',description: 'the user\'s exact words asking you to forget it'}},required: ['query','said']}};
181
181
182
182
// How much of a background command's accumulated output the sniffers re-read on each chunk. Generous
183
183
// next to any single log line, so a url split across chunk boundaries is still found, yet small enough
return{removed: '',message: 'Not removed: the quoted words were not found in what the user typed this run. Tell the user they can remove it from the Memory tab.'};
constwhy=asked.reason==='no-request' ? 'the quoted words do not ask to forget anything' : 'the quoted words do not name this memory';
1574
+
return{removed: '',message: 'Not removed ('+why+'). The closest memory is "'+hit.text+'". If the user wants it gone, quote the words where they asked for it, or tell them they can use Forget on it in the Memory tab.'};
1575
+
}
1576
+
if(!m.factAction(hit.key,'remove')){
1577
+
return{removed: '',message: 'ERROR: "'+hit.text+'" could not be removed: the memory store refused the write, so it is still in effect. Tell the user.'};
1578
+
}
1568
1579
refreshMemoryViews();
1569
1580
return{removed: hit.text,message: 'Removed from memory: "'+hit.text+'". Tell the user what you removed, in case it was the wrong one (saying it again with remember brings it back).'};
0 commit comments