mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-06 05:50:43 +00:00
test: stabilize QA session memory ranking
This commit is contained in:
@@ -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",
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user