Community程式設計與開發github.com

Telegram Crabbox 端到端驗證

用於審查、重現或證明 OpenClaw Telegram 在 Crabbox 上與真實 Telegram 用戶的行為,包括需要代理控制的 Telegram Desktop 錄製、TDLib 用戶驅動命令、Convex 租賃憑證、WebVNC 觀察以及動態修剪的成品。

Telegram Crabbox 端到端驗證 是什麼?

此技能提供了一個受控的端到端測試環境,使 AI 代理能夠操作真實的 Telegram 用戶會話,用於 PR 審查、錯誤重現或視覺化驗證。它通過租用 Crabbox 實例並從 Convex 獲取共享的燒錄帳號憑證,避免了使用個人帳號。代理可以在遠端 Linux 桌面啟動 Telegram Desktop、執行 TDLib 用戶驅動命令、透過 WebVNC 觀察桌面,並錄製桌面影片或 GIF。最終成品會進行運動檢測修剪,並可透過 `publish` 命令直接發布到 PR 評論中,包含裁剪後的聊天面板 GIF,便於乾淨的對比。此技能適用於需要 bot-to-bot 模擬無法涵蓋的真實用戶互動場景。

相容平台~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/clawdbot/clawdbot/tree/main/.agents/skills/telegram-crabbox-e2e-proof

Installed? Explore more 程式設計與開發 skills: steipete/bluebubbles, steipete/eightctl, steipete/blucli · View all 6 →

在你喜歡的 AI 中提問

開啟一個已預先載入此 Agent Skill 的新對話。

說明文件

Telegram Crabbox 端到端驗證 是做什麼的?

當 bot-to-bot 驗證不足時,請使用此技能進行 Telegram PR 審查或錯誤重現。目標是讓代理保持一個真實 Telegram 用戶會話,直到滿意為止,然後附加視覺化證明。

請勿使用個人帳號。請勿將憑證新增到儲存庫、提示詞或成品套件中。執行器從 Convex 租用共享的燒錄帳號。

開始

從待測試的 OpenClaw 儲存庫和分支執行:

proof_cmd="${OPENCLAW_TELEGRAM_USER_PROOF_CMD:-openclaw-telegram-user-crabbox-proof}"
"$proof_cmd" start \
  --tdlib-url http://artifacts.openclaw.ai/tdlib-v1.8.0-linux-x64.tgz \
  --output-dir .artifacts/qa-e2e/telegram-user-crabbox/pr-review

這會啟動一個持久的會話:

  • 租用唯一的 telegram-user Convex 憑證
  • 使用同一個用戶帳號還原 TDLib 和 Telegram Desktop
  • 從當前檢出目錄啟動一個模擬的 OpenClaw Telegram SUT
  • 在可見的 Linux 桌面中選擇已設定的 Telegram 聊天
  • 啟動 24fps 桌面錄製
  • 寫入 .artifacts/qa-e2e/telegram-user-crabbox/pr-review/session.json

在調查期間保持會話存活。代理可以測試數分鐘、執行多個命令、使用 WebVNC、檢查對話記錄,並只在行為被理解後才結束。

若要進行確定性的視覺重現,將確切的模擬模型回覆寫入檔案並傳遞給 start:

proof_cmd="${OPENCLAW_TELEGRAM_USER_PROOF_CMD:-openclaw-telegram-user-crabbox-proof}"
"$proof_cmd" start \
  --tdlib-url http://artifacts.openclaw.ai/tdlib-v1.8.0-linux-x64.tgz \
  --mock-response-file .artifacts/qa-e2e/telegram-user-crabbox/reply.txt \
  --output-dir .artifacts/qa-e2e/telegram-user-crabbox/pr-review

執行器預設使用 --class standard、--record-fps 24、--preview-fps 24 和 --preview-width 1920。除非驗證需要其他設定,否則請保留這些預設值。

測試期間

為了獲取視覺證明,首先發送或識別一個底部標記訊息,然後直接透過訊息 ID 開啟群組/主題:

proof_cmd="${OPENCLAW_TELEGRAM_USER_PROOF_CMD:-openclaw-telegram-user-crabbox-proof}"
"$proof_cmd" view \
  --session .artifacts/qa-e2e/telegram-user-crabbox/pr-review/session.json \
  --message-id <message-id>

這會直接使用 Telegram Desktop 的 tg://privatepost,而非 xdg-open。它還會將 Telegram 調整為 650x1000 大小,並放置在測試的桌面位置上,以便裁剪時可以隔離聊天面板,即使 Telegram 保持分割/側邊欄佈局。在這之後不要按下 Escape,因為 Escape 可能會關閉選中的聊天。

底部行為很重要:

  • 深度連結到最新訊息會讓 Telegram 固定在底部,使後續訊息在錄製中即時顯示
  • 深度連結到較舊的訊息不會自動滾動到新訊息;需要再次連結到最新/最終標記,而不是點擊向下箭頭
  • 裁剪的 GIF 專門使用聊天面板,而不是整個桌面或整個 Telegram 視窗

以真實 Telegram 用戶身份發送:

proof_cmd="${OPENCLAW_TELEGRAM_USER_PROOF_CMD:-openclaw-telegram-user-crabbox-proof}"
"$proof_cmd" send \
  --session .artifacts/qa-e2e/telegram-user-crabbox/pr-review/session.json \
  --text /status

對於斜線命令,省略機器人用戶名;執行器會將訊息發送給 SUT 機器人。

在 Crabbox 上執行任意命令:

proof_cmd="${OPENCLAW_TELEGRAM_USER_PROOF_CMD:-openclaw-telegram-user-crabbox-proof}"
"$proof_cmd" run \
  --session .artifacts/qa-e2e/telegram-user-crabbox/pr-review/session.json \
  -- bash -lc 'source /tmp/openclaw-telegram-user-crabbox/env.sh && python3 /tmp/openclaw-telegram-user-crabbox/user-driver.py transcript --limit 20 --json'

有用的遠端用戶驅動命令:

source /tmp/openclaw-telegram-user-crabbox/env.sh
python3 /tmp/openclaw-telegram-user-crabbox/user-driver.py status --json
python3 /tmp/openclaw-telegram-user-crabbox/user-driver.py chats --json
python3 /tmp/openclaw-telegram-user-crabbox/user-driver.py transcript --limit 20 --json
python3 /tmp/openclaw-telegram-user-crabbox/user-driver.py send --text '/status@{sut}'
python3 /tmp/openclaw-telegram-user-crabbox/user-driver.py probe --text '@{sut} Reply exactly: USER-E2E-{run}' --expect USER-E2E-

不結束會話的情況下擷取當前桌面:

proof_cmd="${OPENCLAW_TELEGRAM_USER_PROOF_CMD:-openclaw-telegram-user-crabbox-proof}"
"$proof_cmd" screenshot \
  --session .artifacts/qa-e2e/telegram-user-crabbox/pr-review/session.json

檢查租賃狀態並獲取 WebVNC 命令:

proof_cmd="${OPENCLAW_TELEGRAM_USER_PROOF_CMD:-openclaw-telegram-user-crabbox-proof}"
"$proof_cmd" status \
  --session .artifacts/qa-e2e/telegram-user-crabbox/pr-review/session.json

完成

始終完成或明確保留盒子:

proof_cmd="${OPENCLAW_TELEGRAM_USER_PROOF_CMD:-openclaw-telegram-user-crabbox-proof}"
"$proof_cmd" finish \
  --session .artifacts/qa-e2e/telegram-user-crabbox/pr-review/session.json \
  --preview-crop telegram-window

finish 會停止錄製、創建經過運動修剪的 MP4/GIF 成品、擷取最終截圖和日誌、釋放 Convex 憑證、停止本地 SUT,以及停止 Crabbox 租賃。--preview-crop telegram-window 還會從測試的 Telegram 驗證視窗創建一個固定尺寸的 GIF,以便在 PR 中進行乾淨的並排對比;完整的桌面影片/GIF 仍保留在成品目錄中。僅在人類需要在憑證釋放後繼續進行 VNC 調試時才傳遞 --keep-box。

在任何失敗或中斷後,請驗證清理:

crabbox list --provider aws

如果存在會話檔案且憑證可能仍被租用,請先使用該會話檔案執行 finish,然後再重試。

附加證明

除非需要日誌,否則僅將有用的視覺成品附加到 PR。執行器預設只輸出 GIF:

proof_cmd="${OPENCLAW_TELEGRAM_USER_PROOF_CMD:-openclaw-telegram-user-crabbox-proof}"
"$proof_cmd" publish \
  --session .artifacts/qa-e2e/telegram-user-crabbox/pr-review/session.json \
  --pr <pr-number> \
  --summary 'Telegram real-user Crabbox session motion GIF'

這會將僅有用的 GIF 複製到一個臨時發布套件中,並在 PR 中評論該 GIF。如果 finish --preview-crop telegram-window 產生了裁剪後的 GIF,則 publish 會使用它;否則使用 telegram-user-crabbox-session-motion.gif。僅在 PR 需要日誌或 JSON 輸出時使用 --full-artifacts。切勿發布憑證載荷、本地環境檔案、TDLib 資料庫、Telegram Desktop 設定檔或原始會話存檔。

對於前後對比證明,在 main 分支上執行一個會話,在 PR head 上執行另一個會話,然後僅從一個乾淨的套件中發布所需的 GIF:

mkdir -p .artifacts/qa-e2e/telegram-user-crabbox/pr-123/comparison
cp <main-output>/telegram-user-crabbox-session-motion-telegram-window.gif \
  .artifacts/qa-e2e/telegram-user-crabbox/pr-123/comparison/main-before.gif
cp <pr-output>/telegram-user-crabbox-session-motion-telegram-window.gif \
  .artifacts/qa-e2e/telegram-user-crabbox/pr-123/comparison/pr-after.gif
crabbox artifacts publish \
  --repo openclaw/openclaw \
  --pr 123 \
  --dir .artifacts/qa-e2e/telegram-user-crabbox/pr-123/comparison \
  --summary 'Telegram before/after proof' \
  --no-comment

然後發布一個包含這兩個 URL 的簡潔 Markdown 表格。除非明確需要,否則不要發布包含截圖、原始影片、日誌、會話 JSON 或裁剪實驗的工作目錄。

快速冒煙測試

對於快速的一次性檢查,請使用:

proof_cmd="${OPENCLAW_TELEGRAM_USER_PROOF_CMD:-openclaw-telegram-user-crabbox-proof}"
"$proof_cmd" --text /status

這是一個 start/send/finish 的快捷方式。對於 PR 審查、問題重現或代理可能需要多次嘗試的任何任務,建議使用持久會話。

Individual skills in this repo

This repo contains 20 individual skills — each has its own dedicated page.

1password

Set up and use 1Password CLI for sign-in, desktop integration, and reading or injecting secrets.

acp-router

Route plain-language requests for Claude Code, Cursor, Copilot, OpenClaw ACP, OpenCode, Gemini CLI, Grok Build, Qwen, Kiro, Kimi, iFlow, Factory Droid, Kilocode, or explicit ACP harness work into either OpenClaw ACP runtime sessions or direct acpx-driven sessions ("telephone game" flow). For coding-agent thread requests, read this skill first, then use only `sessions_spawn` for thread creation. Codex chat binding defaults to the native Codex app-server plugin unless ACP is explicit or background spawn needs ACP.

add-model-provider

Add and live-prove a model provider with non-interactive config one-liners, without exposing credentials.

agent-transcript

Requested GitHub PR/issue agent transcripts: redact, trim, preview, and insert safely.

apple-notes

Create, view, edit, delete, search, move, or export Apple Notes via the memo CLI on macOS.

apple-reminders

List, add, edit, complete, or delete Apple Reminders and reminder lists via remindctl.

auto-qa

Run OpenClaw-wide autonomous QA and live/stress campaigns across independent subsystem lanes, with verified fixes and a resumable evidence report.

autoreview

Structured code review through the shared OpenClaw agent-skills installation.

bear-notes

Create, search, and manage Bear notes via grizzly CLI.

blacksmith-testbox

Run Blacksmith Testbox for CI-parity checks, secrets, hosted services, migrations, or builds local cannot reproduce.

block-kit

Use proactively for structured or interactive Slack replies, and when asked to author or validate native Slack Block Kit JSON.

blogwatcher

Monitor blogs and RSS/Atom feeds for updates using the blogwatcher CLI.

blucli

BluOS CLI (blu) for discovery, playback, grouping, and volume.

bluebubbles

Send and manage iMessages via BlueBubbles, including attachments, tapbacks, edits, replies, and groups.

browser-automation

Use when controlling web pages with the OpenClaw browser tool, especially multi-step flows, login checks, tab management, or recovery from stale refs/timeouts.

camsnap

Capture frames or clips from RTSP/ONVIF cameras and local webcams, including USB pan/tilt/zoom control.

canvas

Present HTML on connected OpenClaw node canvases, navigate/eval/snapshot, and debug canvas host URLs.

channel-message-flows

Use when running QA Lab channel message flow evidence.

clawdtributor

Clawtributor PRs here, last week or another window: discover conversation refs, recheck GitHub, rank by impact.

clawhub

Search ClawHub for plugins by default, or skills and agent Templates when requested; add Templates; install, verify, update, uninstall, publish, or sync skills.

相關技能