This repository now includes a standalone websocket test client for recovery flow development and verification.
It is not coupled to pytest and is intended for local desktop-driven E2E checks.
- Connects to
/recovery/robot_exception/wswithX-ROBOT-KEY. - Sends a predefined payload selected from
scripts/data/payloads.json. - Responds to
type: "screenshot"messages usingpyautogui.screenshot()bytes. - Executes
type: "action"messages automatically usingpyautogui. - Enforces a non-blocking minimum delay between actions (default 1 second).
- Writes optional transcript logs for run analysis.
Payloads are stored in:
scripts/data/payloads.json
Each entry has this shape:
{
"id": 1,
"payload": {
"task_name": "...",
"platform": "...",
"os": "...",
"variables": {},
"ui_log": [],
"errored_act": {},
"model": "..."
}
}Use --payload-id to choose which payload to send.
rtk uv run python -m scripts.recovery_ws_test_client \
--ws-url ws://localhost:8000/recovery/robot_exception/ws \
--robot-key "$X_ROBOT_KEY" \
--payload-file scripts/data/payloads.json \
--payload-id 1 \
--action-delay-seconds 1 \
--log-json tmp/recovery_ws_log.jsonOptional flags:
--dry-run-actions--max-actions <n>--save-screenshots-dir <dir>
- Actions are performed on your active desktop.
- Keep
pyautoguifail-safe enabled (default in runner). - Avoid running this on a machine with unrelated foreground activity.
- Valid payload id runs and reaches websocket session.
- Invalid payload id fails fast before connect.
- Bad robot key is rejected by server.
- Screenshot requests are answered with image bytes.
- Action results are sent with success/failure shape.
- Action execution spacing is at least 1 second.
donefinalizes run with exit code 0 and summary.