test: stabilize QA session memory ranking

This commit is contained in:
Peter Steinberger
2026-04-25 19:04:31 +01:00
parent de0097a23c
commit 73706ca244
3 changed files with 16 additions and 1 deletions

View File

@@ -834,7 +834,9 @@ describe("qa mock openai server", () => {
}),
});
expect(memory.status).toBe(200);
expect(await memory.text()).toContain('"name":"memory_search"');
const memoryText = await memory.text();
expect(memoryText).toContain('"name":"memory_search"');
expect(memoryText).toContain('\\"corpus\\":\\"sessions\\"');
const memoryFollowup = await fetch(`${server.baseUrl}/v1/responses`, {
method: "POST",

View File

@@ -1373,6 +1373,7 @@ async function buildResponsesPayload(
return buildToolCallEventsWithArgs("memory_search", {
query: "current Project Nebula codename ORBIT-10",
maxResults: 3,
corpus: "sessions",
});
}
const results = Array.isArray(toolJson?.results)

View File

@@ -127,6 +127,18 @@ steps:
- ref: transcriptPath
- expr: "[JSON.stringify({ type: 'session', id: config.transcriptId, timestamp: new Date(now - 120000).toISOString() }), JSON.stringify({ type: 'message', message: { role: 'user', timestamp: new Date(now - 90000).toISOString(), content: [{ type: 'text', text: config.transcriptQuestion }] } }), JSON.stringify({ type: 'message', message: { role: 'assistant', timestamp: new Date(now - 60000).toISOString(), content: [{ type: 'text', text: config.transcriptAnswer }] } })].join('\\n') + '\\n'"
- utf8
- call: readRawQaSessionStore
saveAs: sessionStore
args:
- ref: env
- set: sessionStorePath
value:
expr: "path.join(env.gateway.tempRoot, 'state', 'agents', 'qa', 'sessions', 'sessions.json')"
- call: fs.writeFile
args:
- ref: sessionStorePath
- expr: "JSON.stringify({ ...sessionStore, ['agent:qa:seed-session-memory-ranking']: { sessionId: config.transcriptId, updatedAt: now, sessionFile: transcriptPath, origin: { label: 'QA seeded session memory ranking transcript' } } }, null, 2)"
- utf8
- call: forceMemoryIndex
args:
- env: