Files
openclaw/qa/scenarios/memory/memory-tools-channel-context.yaml
Dallin Romney 24ce672e06 refactor(qa): use transport-native actions in flow scenarios (#97962)
* Add QA channel scenario driver contracts

* Route DM baseline through channel scenario driver

* Simplify channel behavior flow runtime helper

* test(qa): use native YAML for DM channel scenario

* test(qa): add conversation flow action

* test(qa): break channel scenario import cycle

* test(qa): fix channel scenario lint

* Unify QA channel scenario transport adapter

* Fix QA transport test type expectations

* refactor(qa): use native transport flow actions

* test(qa): derive direct reply session from transport
2026-07-01 11:39:06 -07:00

82 lines
2.8 KiB
YAML

title: Memory tools in channel context
scenario:
id: memory-tools-channel-context
surface: memory
coverage:
primary:
- memory.tools
secondary:
- channels.group-messages
objective: Verify the agent uses memory tools in a shared channel when the answer lives only in memory files, not the live transcript.
successCriteria:
- Agent uses memory_search before answering.
- Final reply returns the memory-only fact correctly in-channel.
docsRefs:
- docs/concepts/memory.md
- docs/concepts/memory-search.md
codeRefs:
- extensions/memory-core/src/tools.ts
- extensions/qa-lab/src/suite.ts
execution:
kind: flow
summary: Verify the agent uses memory tools in a shared channel when the answer lives only in memory files, not the live transcript.
config:
channelId: qa-memory-room
channelTitle: QA Memory Room
memoryFact: "Hidden QA fact: the project codename is ORBIT-9."
memoryQuery: "hidden project codename"
expectedNeedle: ORBIT-9
prompt: "@openclaw Memory tools check: what is the hidden project codename stored only in memory? Use memory tools first."
promptSnippet: "Memory tools check"
flow:
steps:
- name: uses memory_search before answering in-channel
actions:
- call: reset
- call: fs.writeFile
args:
- expr: "path.join(env.gateway.workspaceDir, 'MEMORY.md')"
- expr: "`${config.memoryFact}\\n`"
- utf8
- call: forceMemoryIndex
args:
- env:
ref: env
query:
expr: config.memoryQuery
expectedNeedle:
expr: config.expectedNeedle
- call: waitForGatewayHealthy
args:
- ref: env
- 60000
- call: waitForQaChannelReady
args:
- ref: env
- 60000
- sendInbound:
conversation:
id:
expr: config.channelId
kind: channel
title:
expr: config.channelTitle
senderId: alice
senderName: Alice
text:
expr: config.prompt
- call: waitForOutboundMessage
saveAs: outbound
args:
- ref: state
- lambda:
params: [candidate]
expr: "candidate.conversation.id === config.channelId && candidate.text.includes(config.expectedNeedle)"
- expr: liveTurnTimeoutMs(env, 30000)
- assert:
expr: "!env.mock || (await fetchJson(`${env.mock.baseUrl}/debug/requests`)).filter((request) => String(request.allInputText ?? '').includes(config.promptSnippet)).some((request) => request.plannedToolName === 'memory_search')"
message: expected memory_search in mock request plan
detailsExpr: outbound.text