OpenClaw QA Testing
Use this skill for qa-lab / qa-channel work. Repo-local QA only.
Read first
docs/concepts/qa-e2e-automation.md
docs/help/testing.md
docs/channels/qa-channel.md
qa/README.md
qa/scenarios/index.yaml
extensions/qa-lab/src/suite.ts
extensions/qa-lab/src/character-eval.ts
Model policy
- Normal live suite runs rely on QA Lab source- and auth-aware defaults.
- Do not pass
--model, --alt-model, or --fast by default. Omitted
--fast does not mean fast is disabled; fast behavior is source-owned.
- For scenario-specific runs, the complete
execution.summary is authoritative
and overrides generic default guidance, including when it requires other
flags. Add explicit provider/model pins only when
execution.config.requiredProvider or requiredModel requires them.
Default workflow
- Read the scenario pack and current suite implementation.
- Decide lane:
- mock/dev:
mock-openai
- real validation:
live-frontier
- For a normal live suite, use:
pnpm openclaw qa suite \
--provider-mode live-frontier \
--output-dir .artifacts/qa-e2e/run-all-live-frontier-<tag>
- Watch outputs:
- summary:
.artifacts/qa-e2e/run-all-live-frontier-<tag>/qa-suite-summary.json
- report:
.artifacts/qa-e2e/run-all-live-frontier-<tag>/qa-suite-report.md
- If the user wants to watch the live UI, find the current
openclaw-qa listen port and report http://127.0.0.1:<port>.
- If a scenario fails, fix the product or harness root cause, then rerun the full lane.
OTEL smoke
For local QA-lab OpenTelemetry validation, use:
pnpm qa:otel:smoke
This starts a local OTLP/HTTP trace receiver, runs the otel-trace-smoke
scenario through qa-channel, decodes the emitted protobuf spans, and verifies
the exported trace names and privacy contract. It does not require Opik,
Langfuse, or external collector credentials.
QA credentials and 1Password
- Use
op only inside tmux for QA secret lookup in this repo.
- Quick auth check inside tmux:
op account list
- Direct Telegram npm live test secrets currently live in 1Password item:
- vault:
OpenClaw
- item:
Telegram E2E
- That item is the first place to look for:
OPENCLAW_QA_TELEGRAM_DRIVER_BOT_TOKEN
OPENCLAW_QA_TELEGRAM_SUT_BOT_TOKEN
OPENCLAW_QA_PROVIDER_MODE
OPENCLAW_NPM_TELEGRAM_PACKAGE_SPEC
- Convex QA secrets currently live in 1Password items:
- vault:
OpenClaw
- item:
OPENCLAW_QA_CONVEX_SITE_URL
- item:
OPENCLAW_QA_CONVEX_SECRET_MAINTAINER
- item:
OPENCLAW_QA_CONVEX_SECRET_CI
- Additional related notes/login items seen during QA credential work:
- vault:
Private
- items:
OPENCLAW QA, Convex, Telegram
- If a required value is missing from those notes:
- do not guess
- ask the maintainer/operator for the current value or the current 1Password item name
- for Telegram direct runs,
OPENCLAW_QA_TELEGRAM_GROUP_ID may be stored separately from Telegram E2E
- for Convex runs, the leased Telegram credential should provide the Telegram group id and bot tokens together; do not require a separate
OPENCLAW_QA_TELEGRAM_GROUP_ID
- for Convex runs, prefer
OpenClaw/OPENCLAW_QA_CONVEX_SITE_URL; if that is stale or unclear, ask for the active pool URL before running
- Prefer direct Telegram envs for the npm Telegram Docker lane when available:
OPENCLAW_QA_TELEGRAM_GROUP_ID="..." \
OPENCLAW_QA_TELEGRAM_DRIVER_BOT_TOKEN="..." \
OPENCLAW_QA_TELEGRAM_SUT_BOT_TOKEN="..." \
OPENCLAW_QA_PROVIDER_MODE="mock-openai" \
OPENCLAW_NPM_TELEGRAM_PACKAGE_SPEC="openclaw@beta" \
pnpm test:docker:npm-telegram-live
- Prefer Convex mode when the goal is stable shared QA infra:
- round-robin credential leasing
- thinner wrapper for channel-specific setup
- CLI/admin flows around the pooled credentials
- Live npm Telegram Docker lane note:
scripts/e2e/npm-telegram-live-runner.ts reads OPENCLAW_NPM_TELEGRAM_PROVIDER_MODE
- do not assume
OPENCLAW_QA_PROVIDER_MODE is consumed by that wrapper
- if a 1Password note only gives
OPENCLAW_QA_PROVIDER_MODE, map it explicitly to OPENCLAW_NPM_TELEGRAM_PROVIDER_MODE before running the Docker lane
- Verified live shape:
- Convex mode can pass the real Docker lane without direct Telegram env vars
- leased Telegram payload includes the group id coupled to the driver/SUT tokens
- a real run of
pnpm test:docker:npm-telegram-live passed with:
OPENCLAW_QA_CREDENTIAL_SOURCE=convex
OPENCLAW_QA_CREDENTIAL_ROLE=maintainer
OPENCLAW_QA_CONVEX_SITE_URL
OPENCLAW_QA_CONVEX_SECRET_MAINTAINER
OPENCLAW_NPM_TELEGRAM_PROVIDER_MODE=mock-openai
- If direct Telegram env is missing locally and
op signin blocks, prefer dispatching the manual GitHub lane because the qa-live-shared environment already has Convex CI credentials:
gh workflow run "NPM Telegram Beta E2E" --repo openclaw/openclaw --ref main \
-f package_spec=openclaw@YYYY.M.D-beta.N \
-f package_label=openclaw@YYYY.M.D-beta.N \
-f provider_mode=mock-openai
- Poll the exact run id from the dispatch URL.
gh run view --json artifacts is not supported; list artifacts with:
gh api repos/openclaw/openclaw/actions/runs/<run-id>/artifacts
WhatsApp live credentials
Use this when setting up or replacing Convex kind=whatsapp credentials.
- Treat WhatsApp QA credentials as operator-owned live accounts, not generated fixtures.
- Use two dedicated WhatsApp-capable test numbers: one driver account and one SUT account. Do not use personal numbers or personal OpenClaw WhatsApp accounts in the shared pool.
- Register and link each account manually with WhatsApp or WhatsApp Business, storing Web auth only in isolated local auth dirs outside the repo.
- For group coverage, create a dedicated test group that includes both QA accounts and store its JID as
groupJid; otherwise the group mention-gating scenario should be skipped by default and fail when explicitly requested.
- Package the two Baileys auth dirs into base64
.tgz payload fields and add a new active Convex credential row. Prefer adding a fresh row and disabling stale/broken rows over overwriting credentials in place.
- Expected payload fields:
driverPhoneE164, sutPhoneE164, driverAuthArchiveBase64, sutAuthArchiveBase64, and optional groupJid.
- Keep credential material out of the repo, logs, PRs, and screenshots. Redact phone numbers unless the operator explicitly asks for local debugging.
- Validate with
pnpm openclaw qa whatsapp --credential-source convex --credential-role maintainer --provider-mode mock-openai and preserve artifact paths plus redacted pass/fail summaries.
- If WhatsApp expires or invalidates a linked Web session, relink locally, package fresh auth archives, add a new Convex row, then disable the stale row.
Character evals
Use qa character-eval for style/persona/vibe checks across multiple live models.
pnpm openclaw qa character-eval \
--output-dir .artifacts/qa-e2e/character-eval-<tag>
- Runs local QA gateway child processes, not Docker.
- Packaged
pnpm build omits QA Lab + qa-channel by design (source-checkout
only). To exercise openclaw qa/qa-channel from a built dist, build with
OPENCLAW_BUILD_PRIVATE_QA=1 pnpm build (emits dist/plugin-sdk/qa-lab.js,
qa-runtime.js, dist/extensions/{qa-lab,qa-channel}) or run via pnpm dev.
- With no model flags, character eval uses its current source-defined candidate,
judge, thinking, and fast defaults.
- Repeat
--model provider/model,thinking=<level>[,fast|,no-fast|,fast=<bool>]
or --judge-model ... only to replace the corresponding inventory explicitly.
- Do not add new examples with separate
--model-thinking; keep that flag as legacy compatibility only.
- Report includes judge ranking, run stats, durations, and full transcripts; do not include raw judge replies. Duration is benchmark context, not a grading signal.
- Candidate and judge concurrency default to 16. Use
--concurrency <n> and --judge-concurrency <n> to override when local gateways or provider limits need a gentler lane.
- Scenario source is YAML-only under
qa/scenarios/: use index.yaml and
per-scenario *.yaml files with top-level title, scenario, and optional
flow. Never add fenced qa-scenario / qa-flow Markdown files.
- For isolated character/persona evals, write the persona into
SOUL.md and blank IDENTITY.md in the scenario flow. Use SOUL.md + IDENTITY.md only when intentionally testing how the normal OpenClaw identity combines with the character.
- Keep prompts natural and task-shaped. The candidate model should receive character setup through
SOUL.md, then normal user turns such as chat, workspace help, and small file tasks; do not ask "how would you react?" or tell the model it is in an eval.
- Prefer at least one real task, such as creating or editing a tiny workspace artifact, so the transcript captures character under normal tool use instead of pure roleplay.
Codex CLI model lane
Use model refs shaped like codex-cli/<codex-model> whenever QA should exercise Codex as a model backend.
Examples:
pnpm openclaw qa suite \
--provider-mode live-frontier \
--model codex-cli/<codex-model> \
--alt-model codex-cli/<codex-model> \
--scenario <scenario-id> \
--output-dir .artifacts/qa-e2e/codex-<tag>
pnpm openclaw qa manual \
--model codex-cli/<codex-model> \
--message "Reply exactly: CODEX_OK"
- Treat the concrete Codex model name as user/config input; do not hardcode it in source, docs examples, or scenarios.
- Live QA preserves
CODEX_HOME so Codex CLI auth/config works while keeping HOME and OPENCLAW_HOME sandboxed.
- Mock QA should scrub
CODEX_HOME.
- If Codex returns fallback/auth text every turn, first check
CODEX_HOME,
relevant secret-backed auth, and gateway child logs before changing
scenario assertions.
- For model comparison, include
codex-cli/<codex-model> as another candidate in qa character-eval; the report should label it as an opaque model name.
Repo facts
- Seed scenarios live in
qa/scenarios/index.yaml and
qa/scenarios/<theme>/*.yaml.
- Main live runner:
extensions/qa-lab/src/suite.ts
- QA lab server:
extensions/qa-lab/src/lab-server.ts
- Child gateway harness:
extensions/qa-lab/src/gateway-child.ts
- Synthetic channel:
extensions/qa-channel/
What “done” looks like
- Full suite green for the requested lane.
- User gets:
- watch URL if applicable
- pass/fail counts
- artifact paths
- concise note on what was fixed
Common failure patterns
- Live timeout too short:
- widen live waits in
extensions/qa-lab/src/suite.ts
- Discovery cannot find repo files:
- point prompts at
repo/... inside seeded workspace
- Subagent proof too brittle:
- prefer stable final reply evidence over transient child-session listing
- Harness “rebuild” delay:
- dirty tree can trigger a pre-run build; expect that before ports appear
When adding scenarios
- Add or update scenario YAML under
qa/scenarios/; do not add .md scenario
files or fenced YAML blocks.
- Keep kickoff expectations in
qa/scenarios/index.yaml aligned
- Add executable coverage in
extensions/qa-lab/src/suite.ts
- Prefer end-to-end assertions over mock-only checks
- Save outputs under
.artifacts/qa-e2e/
1---2name: openclaw-qa-testing3description: Run, watch, debug, extend, or explain OpenClaw qa-lab and qa-channel scenarios, artifacts, and live lanes.4---5
6# OpenClaw QA Testing
7
8Use this skill for `qa-lab` / `qa-channel` work. Repo-local QA only.
9
10## Read first
11
12- `docs/concepts/qa-e2e-automation.md`
13- `docs/help/testing.md`
14- `docs/channels/qa-channel.md`
15- `qa/README.md`
16- `qa/scenarios/index.yaml`
17- `extensions/qa-lab/src/suite.ts`
18- `extensions/qa-lab/src/character-eval.ts`
19
20## Model policy
21
22- Normal live suite runs rely on QA Lab source- and auth-aware defaults.
23- Do not pass `--model`, `--alt-model`, or `--fast` by default. Omitted
24 `--fast` does not mean fast is disabled; fast behavior is source-owned.
25- For scenario-specific runs, the complete `execution.summary` is authoritative
26 and overrides generic default guidance, including when it requires other
27 flags. Add explicit provider/model pins only when
28 `execution.config.requiredProvider` or `requiredModel` requires them.
29
30## Default workflow
31
321. Read the scenario pack and current suite implementation.
332. Decide lane:
34 - mock/dev: `mock-openai`
35 - real validation: `live-frontier`
363. For a normal live suite, use:
37
38```bash
39pnpm openclaw qa suite \
40 --provider-mode live-frontier \
41 --output-dir .artifacts/qa-e2e/run-all-live-frontier-<tag>
42```
43
444. Watch outputs:
45 - summary: `.artifacts/qa-e2e/run-all-live-frontier-<tag>/qa-suite-summary.json`
46 - report: `.artifacts/qa-e2e/run-all-live-frontier-<tag>/qa-suite-report.md`
475. If the user wants to watch the live UI, find the current `openclaw-qa` listen port and report `http://127.0.0.1:<port>`.
486. If a scenario fails, fix the product or harness root cause, then rerun the full lane.
49
50## OTEL smoke
51
52For local QA-lab OpenTelemetry validation, use:
53
54```bash
55pnpm qa:otel:smoke
56```
57
58This starts a local OTLP/HTTP trace receiver, runs the `otel-trace-smoke`
59scenario through qa-channel, decodes the emitted protobuf spans, and verifies
60the exported trace names and privacy contract. It does not require Opik,
61Langfuse, or external collector credentials.
62
63## QA credentials and 1Password
64
65- Use `op` only inside `tmux` for QA secret lookup in this repo.
66- Quick auth check inside tmux:
67
68```bash
69op account list
70```
71
72- Direct Telegram npm live test secrets currently live in 1Password item:
73 - vault: `OpenClaw`
74 - item: `Telegram E2E`
75- That item is the first place to look for:
76 - `OPENCLAW_QA_TELEGRAM_DRIVER_BOT_TOKEN`
77 - `OPENCLAW_QA_TELEGRAM_SUT_BOT_TOKEN`
78 - `OPENCLAW_QA_PROVIDER_MODE`
79 - `OPENCLAW_NPM_TELEGRAM_PACKAGE_SPEC`
80- Convex QA secrets currently live in 1Password items:
81 - vault: `OpenClaw`
82 - item: `OPENCLAW_QA_CONVEX_SITE_URL`
83 - item: `OPENCLAW_QA_CONVEX_SECRET_MAINTAINER`
84 - item: `OPENCLAW_QA_CONVEX_SECRET_CI`
85- Additional related notes/login items seen during QA credential work:
86 - vault: `Private`
87 - items: `OPENCLAW QA`, `Convex`, `Telegram`
88- If a required value is missing from those notes:
89 - do not guess
90 - ask the maintainer/operator for the current value or the current 1Password item name
91 - for Telegram direct runs, `OPENCLAW_QA_TELEGRAM_GROUP_ID` may be stored separately from `Telegram E2E`
92 - for Convex runs, the leased Telegram credential should provide the Telegram group id and bot tokens together; do not require a separate `OPENCLAW_QA_TELEGRAM_GROUP_ID`
93 - for Convex runs, prefer `OpenClaw/OPENCLAW_QA_CONVEX_SITE_URL`; if that is stale or unclear, ask for the active pool URL before running
94- Prefer direct Telegram envs for the npm Telegram Docker lane when available:
95
96```bash
97OPENCLAW_QA_TELEGRAM_GROUP_ID="..." \
98OPENCLAW_QA_TELEGRAM_DRIVER_BOT_TOKEN="..." \
99OPENCLAW_QA_TELEGRAM_SUT_BOT_TOKEN="..." \
100OPENCLAW_QA_PROVIDER_MODE="mock-openai" \
101OPENCLAW_NPM_TELEGRAM_PACKAGE_SPEC="openclaw@beta" \
102pnpm test:docker:npm-telegram-live
103```
104
105- Prefer Convex mode when the goal is stable shared QA infra:
106 - round-robin credential leasing
107 - thinner wrapper for channel-specific setup
108 - CLI/admin flows around the pooled credentials
109- Live npm Telegram Docker lane note:
110 - `scripts/e2e/npm-telegram-live-runner.ts` reads `OPENCLAW_NPM_TELEGRAM_PROVIDER_MODE`
111 - do not assume `OPENCLAW_QA_PROVIDER_MODE` is consumed by that wrapper
112 - if a 1Password note only gives `OPENCLAW_QA_PROVIDER_MODE`, map it explicitly to `OPENCLAW_NPM_TELEGRAM_PROVIDER_MODE` before running the Docker lane
113- Verified live shape:
114 - Convex mode can pass the real Docker lane without direct Telegram env vars
115 - leased Telegram payload includes the group id coupled to the driver/SUT tokens
116 - a real run of `pnpm test:docker:npm-telegram-live` passed with:
117 - `OPENCLAW_QA_CREDENTIAL_SOURCE=convex`
118 - `OPENCLAW_QA_CREDENTIAL_ROLE=maintainer`
119 - `OPENCLAW_QA_CONVEX_SITE_URL`
120 - `OPENCLAW_QA_CONVEX_SECRET_MAINTAINER`
121 - `OPENCLAW_NPM_TELEGRAM_PROVIDER_MODE=mock-openai`
122- If direct Telegram env is missing locally and `op signin` blocks, prefer dispatching the manual GitHub lane because the `qa-live-shared` environment already has Convex CI credentials:
123
124```bash
125gh workflow run "NPM Telegram Beta E2E" --repo openclaw/openclaw --ref main \
126 -f package_spec=openclaw@YYYY.M.D-beta.N \
127 -f package_label=openclaw@YYYY.M.D-beta.N \
128 -f provider_mode=mock-openai
129```
130
131- Poll the exact run id from the dispatch URL. `gh run view --json artifacts` is not supported; list artifacts with:
132
133```bash
134gh api repos/openclaw/openclaw/actions/runs/<run-id>/artifacts
135```
136
137## WhatsApp live credentials
138
139Use this when setting up or replacing Convex `kind=whatsapp` credentials.
140
141- Treat WhatsApp QA credentials as operator-owned live accounts, not generated fixtures.
142- Use two dedicated WhatsApp-capable test numbers: one driver account and one SUT account. Do not use personal numbers or personal OpenClaw WhatsApp accounts in the shared pool.
143- Register and link each account manually with WhatsApp or WhatsApp Business, storing Web auth only in isolated local auth dirs outside the repo.
144- For group coverage, create a dedicated test group that includes both QA accounts and store its JID as `groupJid`; otherwise the group mention-gating scenario should be skipped by default and fail when explicitly requested.
145- Package the two Baileys auth dirs into base64 `.tgz` payload fields and add a new active Convex credential row. Prefer adding a fresh row and disabling stale/broken rows over overwriting credentials in place.
146- Expected payload fields: `driverPhoneE164`, `sutPhoneE164`, `driverAuthArchiveBase64`, `sutAuthArchiveBase64`, and optional `groupJid`.
147- Keep credential material out of the repo, logs, PRs, and screenshots. Redact phone numbers unless the operator explicitly asks for local debugging.
148- Validate with `pnpm openclaw qa whatsapp --credential-source convex --credential-role maintainer --provider-mode mock-openai` and preserve artifact paths plus redacted pass/fail summaries.
149- If WhatsApp expires or invalidates a linked Web session, relink locally, package fresh auth archives, add a new Convex row, then disable the stale row.
150
151## Character evals
152
153Use `qa character-eval` for style/persona/vibe checks across multiple live models.
154
155```bash
156pnpm openclaw qa character-eval \
157 --output-dir .artifacts/qa-e2e/character-eval-<tag>
158```
159
160- Runs local QA gateway child processes, not Docker.
161- Packaged `pnpm build` omits QA Lab + qa-channel by design (source-checkout
162 only). To exercise `openclaw qa`/qa-channel from a built dist, build with
163 `OPENCLAW_BUILD_PRIVATE_QA=1 pnpm build` (emits `dist/plugin-sdk/qa-lab.js`,
164 `qa-runtime.js`, `dist/extensions/{qa-lab,qa-channel}`) or run via `pnpm dev`.
165- With no model flags, character eval uses its current source-defined candidate,
166 judge, thinking, and fast defaults.
167- Repeat `--model provider/model,thinking=<level>[,fast|,no-fast|,fast=<bool>]`
168 or `--judge-model ...` only to replace the corresponding inventory explicitly.
169- Do not add new examples with separate `--model-thinking`; keep that flag as legacy compatibility only.
170- Report includes judge ranking, run stats, durations, and full transcripts; do not include raw judge replies. Duration is benchmark context, not a grading signal.
171- Candidate and judge concurrency default to 16. Use `--concurrency <n>` and `--judge-concurrency <n>` to override when local gateways or provider limits need a gentler lane.
172- Scenario source is YAML-only under `qa/scenarios/`: use `index.yaml` and
173 per-scenario `*.yaml` files with top-level `title`, `scenario`, and optional
174 `flow`. Never add fenced `qa-scenario` / `qa-flow` Markdown files.
175- For isolated character/persona evals, write the persona into `SOUL.md` and blank `IDENTITY.md` in the scenario flow. Use `SOUL.md + IDENTITY.md` only when intentionally testing how the normal OpenClaw identity combines with the character.
176- Keep prompts natural and task-shaped. The candidate model should receive character setup through `SOUL.md`, then normal user turns such as chat, workspace help, and small file tasks; do not ask "how would you react?" or tell the model it is in an eval.
177- Prefer at least one real task, such as creating or editing a tiny workspace artifact, so the transcript captures character under normal tool use instead of pure roleplay.
178
179## Codex CLI model lane
180
181Use model refs shaped like `codex-cli/<codex-model>` whenever QA should exercise Codex as a model backend.
182
183Examples:
184
185```bash
186pnpm openclaw qa suite \
187 --provider-mode live-frontier \
188 --model codex-cli/<codex-model> \
189 --alt-model codex-cli/<codex-model> \
190 --scenario <scenario-id> \
191 --output-dir .artifacts/qa-e2e/codex-<tag>
192```
193
194```bash
195pnpm openclaw qa manual \
196 --model codex-cli/<codex-model> \
197 --message "Reply exactly: CODEX_OK"
198```
199
200- Treat the concrete Codex model name as user/config input; do not hardcode it in source, docs examples, or scenarios.
201- Live QA preserves `CODEX_HOME` so Codex CLI auth/config works while keeping `HOME` and `OPENCLAW_HOME` sandboxed.
202- Mock QA should scrub `CODEX_HOME`.
203- If Codex returns fallback/auth text every turn, first check `CODEX_HOME`,
204 relevant secret-backed auth, and gateway child logs before changing
205 scenario assertions.
206- For model comparison, include `codex-cli/<codex-model>` as another candidate in `qa character-eval`; the report should label it as an opaque model name.
207
208## Repo facts
209
210- Seed scenarios live in `qa/scenarios/index.yaml` and
211 `qa/scenarios/<theme>/*.yaml`.
212- Main live runner: `extensions/qa-lab/src/suite.ts`
213- QA lab server: `extensions/qa-lab/src/lab-server.ts`
214- Child gateway harness: `extensions/qa-lab/src/gateway-child.ts`
215- Synthetic channel: `extensions/qa-channel/`
216
217## What “done” looks like
218
219- Full suite green for the requested lane.
220- User gets:
221 - watch URL if applicable
222 - pass/fail counts
223 - artifact paths
224 - concise note on what was fixed
225
226## Common failure patterns
227
228- Live timeout too short:
229 - widen live waits in `extensions/qa-lab/src/suite.ts`
230- Discovery cannot find repo files:
231 - point prompts at `repo/...` inside seeded workspace
232- Subagent proof too brittle:
233 - prefer stable final reply evidence over transient child-session listing
234- Harness “rebuild” delay:
235 - dirty tree can trigger a pre-run build; expect that before ports appear
236
237## When adding scenarios
238
239- Add or update scenario YAML under `qa/scenarios/`; do not add `.md` scenario
240 files or fenced YAML blocks.
241- Keep kickoff expectations in `qa/scenarios/index.yaml` aligned
242- Add executable coverage in `extensions/qa-lab/src/suite.ts`
243- Prefer end-to-end assertions over mock-only checks
244- Save outputs under `.artifacts/qa-e2e/`