Repository navigation
feat(qa): standalone Telegram Desktop recorder with a prebaked desktop image - #125186
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: needs maintainer review before merge. Reviewed August 19, 2026, 1:50 AM ET / 05:50 UTC. ClawSweeper reviewWhat this changesThe PR adds a standalone Telegram Desktop recorder, a pinned local Docker desktop image, shared Crabbox helpers, documentation, and regression coverage for recording Telegram proof artifacts. Merge readinessKeep open for maintainer review: the latest scope statement intentionally makes this a standalone QA utility, resolving the prior workflow-integration concern without claiming the existing Mantis workflow was migrated. Priority: P2 Review scores
Verification
How this fits togetherThe QA proof tooling leases a desktop, authorizes Telegram Desktop through an external user driver, records a real chat interaction, and emits review artifacts. This PR adds a reusable recorder and image while the existing Mantis workflow continues using its current proof runner. flowchart LR
A[Operator or E2E driver] --> B[Telegram Desktop recorder]
B --> C[Docker or Crabbox desktop]
C --> D[Telegram Desktop authorization]
D --> E[Screen recording and crop]
E --> F[Proof artifacts]
G[Existing Mantis workflow] --> H[Existing proof runner]
Decision needed
Why: This adds a durable operator-facing QA command and image; the contributor states the intended scope, but the protected maintainer label requires an explicit maintainer merge decision. Before merge
Agent review detailsSecurityNone. PR surfaceTests +680, Docs +52, Config +1, Other +1392. Total +2125 across 10 files. View PR surface stats
Review metrics
Stored data modelPersistent data-model change detected: Merge-risk options
Maintainer options:
Technical reviewBest possible solution: Accept the recorder as a supported standalone QA surface if that scope remains desired, then route workflow migration through a separate proof-backed change. Do we have a high-confidence way to reproduce the issue? Not applicable: this PR introduces a new standalone QA utility rather than reporting a current product failure; the supplied after-fix run demonstrates its intended flow. Is this the best way to solve the issue? Yes for the stated scope: retaining the existing runner and documenting the recorder as standalone avoids mixing workflow migration into this feature; maintainers must still accept that product boundary. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 2bcc06cc2270. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (7 earlier review cycles)
|
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. |
…; bake runs from an admin login - --lease-id boxes are never stopped by the recorder (ownership persisted in recorder.json) - --keep-box keeps the Desktop authorization for WebVNC; a later stop revokes it - drop the image-bake workflow: a mutable crabbox_ref would run under an admin token; the bake is an operator script probing for coordinator admin (GitHub admin owner) before any lease
5cb0b79 to
2b2ee1d
Compare
- no src/ import from scripts/e2e: --user-driver is a whitespace-separated prefix - drop unused exports flagged by the deadcode gate
Live end-to-end runs surfaced failures that unit tests cannot reach: - container sshd tears down the session process group, so Telegram must be launched with setsid and closed stdin - pkill/pgrep -f patterns matched the launcher's own shell, killing it - a confirmed QR code is not proof of login: Telegram rotates the token and ignores stale confirmations, so authorize now verifies the client left the login screen and retries with a fresh code - scrot exits 0 but keeps the existing file, so every capture after the first was stale; all captures now pass -o (this also affected the proof runner) - the cropped preview used a fixed rectangle and cut the chat pane; the crop now comes from the window geometry measured at record time - stop treats an already-released lease as the desired end state
Live end-to-end proof (local Docker desktop)The recorder now runs against a local Docker desktop as well as the AWS variant image, so it needs no Crabbox coordinator admin. Full drive through the Telegram userbot skill ( Recorded TDLib timeline for the same turn: 3 messages / 4 typing / 2 reactions (2 from the SUT), 2 draft revisions. Cropped chat pane (motion-trimmed, 650×1000, 20 s) — note the live "Foreman is typing" indicator and the reaction animation: Full desktop frame the crop is derived from: Bugs this live run found (all fixed in
|
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
Exact-head local Docker proof for the image runtime user (rank-up move), on The |
The recorder's proven path is the local Docker desktop image; publishing the AWS catalog-only variant needs coordinator admin we do not have, so the bake and promotion tooling lands separately with that access.
|
Maintainer decision on scope (recorded for the review gate): The standalone recorder plus the prebaked desktop image is the intended supported surface for this PR. The point of the prebaked image is that a consumer — today an operator or an external Telegram userbot driver, tomorrow the Mantis proof workflow — no longer spends minutes installing a desktop per lease (11.8 s to a ready desktop versus ~3–4 min of apt and downloads, which is also where the Routing the |
…desktop image (openclaw#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.


What Problem This Solves
Recording native Telegram Desktop for OpenClaw proof runs meant bootstrapping a fresh cloud desktop every session: ~20 apt packages, a Telegram Desktop download, and a TDLib download per lease, roughly 3–4 minutes of setup that also raced Ubuntu's
unattended-upgrades(Could not get lock /var/lib/dpkg/lock-frontendkilled two of the last five Mantis Telegram runs outright). Every consumer that wants a Telegram Desktop recording paid that cost and inherited that flakiness.Why This Change Was Made
Ship the desktop as a prebaked image and the recording as a standalone tool, so callers spend their time on the turn under test instead of on setup.
scripts/mantis/telegram-desktop-image/Dockerfile+build-telegram-desktop-image.sh: a digest-pinned Ubuntu base with checksum-pinned Telegram Desktop 7.0.9 (updater removed, version marker written) plus the XFCE/Xvfb/capture tooling a lease would otherwise install. Selected throughCRABBOX_LOCAL_CONTAINER_IMAGE; a ready desktop in 11.8 s, with zero apt work per lease.scripts/e2e/telegram-desktop-recorder.ts(pnpm qa:telegram-desktop-recorder):start | view | screenshot | stop | status. It records and nothing else — it never drives OpenClaw or sends Telegram messages.startleases a desktop (--provider dockerlocally;--provider awsselects a Crabbox catalog-only variant image where one is published), preflights the image contract and fails fast rather than installing anything, launches Telegram, gets it authorized by handing the QR to the caller's own TDLib driver (--user-driver … confirm-qr), pins the chat pane, and starts x11grab.stopproduces the motion-trimmed MP4/GIF plus a crop taken from the window geometry measured at record time, terminates the Desktop authorization, and releases the box.scripts/e2e/telegram-desktop-crabbox.ts: ssh/scp/inspect/preview/crop helpers extracted fromtelegram-user-crabbox-proof.ts(4100 → 3546 LOC) and shared; that runner's behavior is unchanged apart from one fix below.Scope: this PR ships the tool and the image. Nothing in this repository invokes the recorder yet — the
Mantis Telegram Desktop Proofworkflow still runs its container-based proof runner. Routing that workflow (and its dual-worktree build) through the recorder is a follow-up, where it can get its own live proof.User Impact
Anyone needing a native Telegram Desktop recording — a maintainer at a terminal, or an external E2E driver — gets a ready desktop in ~12 s and a cropped, motion-trimmed GIF of the real client, with no per-lease installs and no coordinator admin required for the local path.
Evidence
Live end-to-end drive through an external Telegram userbot driver (leases the shared QA Telegram user, starts a SUT gateway + mock provider from this checkout, boots the desktop, QR-authorizes through the caller's TDLib, sends a real turn, records): exit 0,
cleanupErrors: null, lease released, Desktop session terminated. Recorded TDLib timeline for the same turn: 3 messages / 4 typing / 2 reactions, 2 draft revisions.Cropped chat pane (650×1000, motion-trimmed, 20 s) — note the live "Foreman is typing" indicator:
Full desktop frame the crop is derived from:
That live run found six defects that unit tests cannot reach; each is fixed here with a regression test: container sshd killing the backgrounded client (
setsid),pkill -fmatching the launcher's own shell, a confirmed QR code not implying login (Telegram rotates the token),scrotexiting 0 while silently keeping the existing file (every capture after the first was stale — this also affectedtelegram-user-crabbox-proof.ts), a fixed crop rectangle cutting the chat pane, andstoptreating an already-released lease as a failure. Details: #125186 (comment)Exact-head local proof (
4bb5434047d): image builds from the pinned digest;crabbox warmup --provider docker --desktop→warmup complete total=10.599s; recorder golden-image preflight →PREFLIGHT-OK; lease stopped.Validation:
pnpm test(recorder, proof runner, workflow) → 76 passed;pnpm tsgo:scripts,pnpm tsgo:test:root, deadcode-exports, docker-e2e boundaries, oxlint, oxfmt,git diff --check→ clean.