chore(core): Remove redundant memory string from OM (no-changelog) (#31278)

This commit is contained in:
Riqwan Thamir 2026-05-28 14:08:53 +02:00 committed by GitHub
parent 71b35e298d
commit a5e656edb9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 6 additions and 8 deletions

View File

@ -143,17 +143,17 @@ describe('AgentMessageList — forLlm observation memory', () => {
it('injects the rendered observation log into the system prompt', () => {
const list = new AgentMessageList();
list.observationLogMemory = [
'## Memory',
'',
'<observations>',
'The following is your memory of this conversation.',
'',
'* CRITICAL (14:30) User wants the SDK to stay unopinionated.',
'</observations>',
].join('\n');
const prompt = systemContent(list);
expect(prompt).toContain('Base instructions');
expect(prompt).toContain('## Memory');
expect(prompt).toContain('<observations>');
expect(prompt).toContain('* CRITICAL (14:30) User wants the SDK to stay unopinionated.');
});

View File

@ -69,7 +69,7 @@ describe('observation-log observer defaults', () => {
transcriptTokenCount: 42,
observationLogTail: [],
renderedObservationLogTail:
'## Memory\n\n* CRITICAL (14:28) User is rebuilding observational memory.',
'<observations>\n* CRITICAL (14:28) User is rebuilding observational memory.\n</observations>',
});
expect(prompt).toContain('Current timestamp: 2026-05-12T14:30:00.000Z');

View File

@ -40,8 +40,6 @@ describe('renderObservationLog', () => {
expect(renderObservationLog([child, dropped, parent])).toBe(
[
'<observations>',
'## Memory',
'',
'The following is your memory of this conversation. It accumulates as observations are made. Older entries may have been merged or dropped during periodic restructuring.',
'Marker legend: CRITICAL = must retain, IMPORTANT = useful continuity, INFO = contextual detail, COMPLETION = completed/resolved.',
'',

View File

@ -78,7 +78,7 @@ export function renderObservationLog(
if (roots.length === 0) return null;
const lines: string[] = ['<observations>', '## Memory', '', MEMORY_INTRO, MARKER_LEGEND, ''];
const lines: string[] = ['<observations>', MEMORY_INTRO, MARKER_LEGEND, ''];
for (const root of roots) {
lines.push(renderBullet(root));
for (const child of childrenByParent.get(root.id) ?? []) {

View File

@ -28,7 +28,7 @@ describe('n8n observation-log observer policy', () => {
transcriptTokenCount: 42,
observationLogTail: [],
renderedObservationLogTail:
'## Memory\n\n* CRITICAL (14:28) User is rebuilding observational memory.',
'<observations>\n* CRITICAL (14:28) User is rebuilding observational memory.\n</observations>',
});
expect(prompt).toContain('Current timestamp: 2026-05-12T14:30:00.000Z');