
























@@ -0,0 +1,136 @@
1+---
2+name: telegram-crabbox-e2e-proof
3+description: Use when reviewing, reproducing, or proving OpenClaw Telegram behavior with a real Telegram user on Crabbox, including PR review workflows that need an agent-controlled Telegram Desktop recording, TDLib user-driver commands, Convex-leased credentials, WebVNC observation, and motion-trimmed artifacts.
4+---
5+6+# Telegram Crabbox E2E Proof
7+8+Use this for Telegram PR review or bug reproduction when bot-to-bot proof is
9+not enough. The goal is to let the agent keep a real Telegram user session open
10+until it is satisfied, then attach visual proof.
11+12+Do not use personal accounts. Do not add credentials to the repo, prompt, or
13+artifact bundle. The runner leases the shared burner account from Convex.
14+15+## Start
16+17+Run from the OpenClaw repo and branch under test:
18+19+```bash
20+pnpm qa:telegram-user:crabbox -- start \
21+ --tdlib-url http://artifacts.openclaw.ai/tdlib-v1.8.0-linux-x64.tgz \
22+ --output-dir .artifacts/qa-e2e/telegram-user-crabbox/pr-review
23+```
24+25+This starts one held session:
26+27+- leases the exclusive `telegram-user` Convex credential
28+- restores TDLib and Telegram Desktop with the same user account
29+- starts a mock OpenClaw Telegram SUT from the current checkout
30+- selects the configured Telegram chat in the visible Linux desktop
31+- starts desktop recording
32+- writes `.artifacts/qa-e2e/telegram-user-crabbox/pr-review/session.json`
33+34+Keep the session alive while investigating. It is valid for the agent to test
35+for minutes, run several commands, use WebVNC, inspect transcripts, and only
36+finish once the behavior is understood.
37+38+## While Testing
39+40+Send as the real Telegram user:
41+42+```bash
43+pnpm qa:telegram-user:crabbox -- send \
44+ --session .artifacts/qa-e2e/telegram-user-crabbox/pr-review/session.json \
45+ --text /status
46+```
47+48+For slash commands, omit the bot username; the runner targets the SUT bot.
49+50+Run arbitrary commands on the Crabbox:
51+52+```bash
53+pnpm qa:telegram-user:crabbox -- run \
54+ --session .artifacts/qa-e2e/telegram-user-crabbox/pr-review/session.json \
55+ -- bash -lc 'source /tmp/openclaw-telegram-user-crabbox/env.sh && python3 /tmp/openclaw-telegram-user-crabbox/user-driver.py transcript --limit 20 --json'
56+```
57+58+Useful remote user-driver commands:
59+60+```bash
61+source /tmp/openclaw-telegram-user-crabbox/env.sh
62+python3 /tmp/openclaw-telegram-user-crabbox/user-driver.py status --json
63+python3 /tmp/openclaw-telegram-user-crabbox/user-driver.py chats --json
64+python3 /tmp/openclaw-telegram-user-crabbox/user-driver.py transcript --limit 20 --json
65+python3 /tmp/openclaw-telegram-user-crabbox/user-driver.py send --text '/status@{sut}'
66+python3 /tmp/openclaw-telegram-user-crabbox/user-driver.py probe --text '@{sut} Reply exactly: USER-E2E-{run}' --expect USER-E2E-
67+```
68+69+Capture the current desktop without ending the session:
70+71+```bash
72+pnpm qa:telegram-user:crabbox -- screenshot \
73+ --session .artifacts/qa-e2e/telegram-user-crabbox/pr-review/session.json
74+```
75+76+Check lease state and get the WebVNC command:
77+78+```bash
79+pnpm qa:telegram-user:crabbox -- status \
80+ --session .artifacts/qa-e2e/telegram-user-crabbox/pr-review/session.json
81+```
82+83+## Finish
84+85+Always finish or explicitly keep the box:
86+87+```bash
88+pnpm qa:telegram-user:crabbox -- finish \
89+ --session .artifacts/qa-e2e/telegram-user-crabbox/pr-review/session.json
90+```
91+92+`finish` stops recording, creates motion-trimmed MP4/GIF artifacts, captures a
93+final screenshot and logs, releases the Convex credential, stops the local SUT,
94+and stops the Crabbox lease. Pass `--keep-box` only when a human needs to
95+continue VNC debugging after the credential is released.
96+97+After any failure or interruption, verify cleanup:
98+99+```bash
100+crabbox list --provider aws
101+```
102+103+If a session file exists and the credential may still be leased, run `finish`
104+with that session file before retrying.
105+106+## Attach Proof
107+108+Attach only the useful visual artifact to the PR unless logs are needed:
109+110+```bash
111+rm -rf .artifacts/qa-e2e/telegram-user-crabbox/pr-gif-only
112+mkdir -p .artifacts/qa-e2e/telegram-user-crabbox/pr-gif-only
113+cp .artifacts/qa-e2e/telegram-user-crabbox/pr-review/telegram-user-crabbox-session-motion.gif \
114+ .artifacts/qa-e2e/telegram-user-crabbox/pr-gif-only/telegram-user-crabbox-session-motion.gif
115+crabbox artifacts publish \
116+ --pr <pr-number> \
117+ --repo openclaw/openclaw \
118+ --dir .artifacts/qa-e2e/telegram-user-crabbox/pr-gif-only \
119+ --summary 'Telegram real-user Crabbox session motion GIF' \
120+ --template openclaw
121+```
122+123+Use full artifact publishing only when the PR needs logs or JSON output. Never
124+publish credential payloads, local env files, TDLib databases, Telegram Desktop
125+profiles, or raw session archives.
126+127+## Quick Smoke
128+129+For a fast one-shot check, use:
130+131+```bash
132+pnpm qa:telegram-user:crabbox -- --text /status
133+```
134+135+This is a start/send/finish shortcut. Prefer the held session for PR review,
136+issue reproduction, or any task where the agent may need several attempts.
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。