mirror of
https://github.com/n8n-io/n8n.git
synced 2026-06-01 01:07:04 +02:00
chore(core): Remove redundant memory string from OM (no-changelog) (#31278)
This commit is contained in:
parent
71b35e298d
commit
a5e656edb9
|
|
@ -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.');
|
||||
});
|
||||
|
||||
|
|
|
|||
|
|
@ -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');
|
||||
|
|
|
|||
|
|
@ -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.',
|
||||
'',
|
||||
|
|
|
|||
|
|
@ -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) ?? []) {
|
||||
|
|
|
|||
|
|
@ -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');
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user