Skip to content

Commit 97e3136

Browse files
authored
feat(qa): add a standalone Telegram Desktop recorder with a prebaked desktop image (#125186)
Records native Telegram Desktop from a digest-pinned prebaked image: a ready desktop in ~12s with no per-lease apt installs or downloads, which also removes the dpkg-lock failures that killed recent runs. The recorder only records; callers drive the turn and supply the TDLib driver used for QR authorization. Nothing in this repository invokes it yet - routing the Mantis Telegram Desktop Proof workflow through it is a follow-up.
1 parent c9afcbb commit 97e3136

10 files changed

Lines changed: 2739 additions & 614 deletions

‎docs/concepts/mantis.md‎

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,58 @@ scenario observed, not the live Slack UI; `slack-desktop-smoke.png` is only
199199
proof of Slack Web itself when the lease's browser profile was already logged
200200
in.
201201

202+
### Telegram Desktop recorder
203+
204+
The Telegram Desktop recorder is a standalone operator utility, invoked
205+
directly through `pnpm qa:telegram-desktop-recorder`. It records native
206+
Telegram Desktop and nothing else: it never drives OpenClaw or sends Telegram
207+
messages. Whoever runs it owns the turn — start the SUT, send through a real
208+
Telegram user, then tell the recorder which message to show — and supplies
209+
`--user-driver`, the command the recorder shells out to for the TDLib calls it
210+
cannot make itself (`confirm-qr`, `terminate-session`). Any driver exposing
211+
those two verbs works, including this repo's
212+
`scripts/e2e/telegram-user-driver.py`.
213+
214+
Nothing in this repository invokes it yet: the `Mantis Telegram Desktop Proof`
215+
workflow still runs its own container-based proof runner, and moving that
216+
workflow onto the recorder is a separate change.
217+
218+
Start a fresh authorized desktop and begin recording:
219+
220+
```bash
221+
pnpm qa:telegram-desktop-recorder start \
222+
--output-dir .artifacts/qa-e2e/telegram-desktop \
223+
--chat -1001234567890 \
224+
--user-driver "python3 /path/to/telegram-user-driver.py" \
225+
--json
226+
```
227+
228+
Use `view --session <recorder.json> --message-id <id>` to open a recorded
229+
group post. Use `screenshot --session <recorder.json>` for a still image. Run
230+
`stop --session <recorder.json> --crop telegram-window` to copy the recording
231+
and logs, build motion GIFs, terminate the Telegram Desktop authorization, and
232+
release the Crabbox lease. Add `--keep-box` only when the lease must remain
233+
available for WebVNC inspection.
234+
235+
The recorder defaults to Crabbox's local Docker desktop path. Build the pinned
236+
image once, then run `start` without coordinator access:
237+
238+
```bash
239+
bash scripts/mantis/build-telegram-desktop-image.sh
240+
```
241+
242+
`--provider aws` targets a Crabbox catalog-only Telegram variant image
243+
(`--image-sdk telegram-desktop=7.0.9`) so the generic desktop image never
244+
carries the client. Publishing that variant needs Crabbox coordinator admin
245+
(`crabbox image create` / `image promote`) and is not part of this repository
246+
yet; until it is published, use the local Docker image above. Either image must
247+
provide an
248+
executable Telegram Desktop at `/opt/Telegram/Telegram`, a readable desktop
249+
version marker, `wmctrl`, `xdotool`, `scrot`, `ffmpeg`, `zbarimg`, and
250+
`xdpyinfo`, plus a reachable `DISPLAY=:99`. Crabbox refuses the lease when no
251+
matching image is promoted, and recorder startup fails when the contract is
252+
incomplete. It does not install packages or download replacements.
253+
202254
### `telegram-desktop-builder`
203255

204256
```bash

‎package.json‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1737,6 +1737,7 @@
17371737
"proxy:run": "node scripts/run-node.mjs proxy run",
17381738
"proxy:start": "node scripts/run-node.mjs proxy start",
17391739
"qa:e2e": "node --import tsx scripts/qa-e2e.ts",
1740+
"qa:telegram-desktop-recorder": "node --import tsx scripts/e2e/telegram-desktop-recorder.ts",
17401741
"qa:lab:build": "vite build --config extensions/qa-lab/web/vite.config.ts",
17411742
"qa:lab:ui": "pnpm openclaw qa ui",
17421743
"qa:lab:up": "node --import tsx scripts/qa-lab-up.ts",

0 commit comments

Comments
 (0)