Spaces:
Sleeping
Sleeping
fix: delete devices dir to force fresh auto-pair, skip error replies
Browse files- Delete ~/.openclaw/devices/ on startup to force fresh auto-pair
with operator.write/read scopes (fixes A2A dispatch error)
- Conversation loop now checks task state=failed and skips errors
- Force rebuild (v3.9)
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Files changed (3)
1234# OpenClaw on Hugging Face Spaces β Pre-built image (v3.8)# Uses official pre-built image to avoid 30+ minute builds on cpu-basic# ββ Stage 1: Pull pre-built OpenClaw βββββββββββββββββββββββββββββββββββββββββ1234# OpenClaw on Hugging Face Spaces β Pre-built image (v3.9)# Uses official pre-built image to avoid 30+ minute builds on cpu-basic# ββ Stage 1: Pull pre-built OpenClaw βββββββββββββββββββββββββββββββββββββββββ
30 unmodified lines31323334353630 unmodified linestry:resp = requests.post(f"{url}/a2a/jsonrpc", json=payload, timeout=90)data = resp.json()parts = data.get("result", {}).get("status", {}).get("message", {}).get("parts", [])for p in parts:if p.get("kind") == "text" or p.get("type") == "text":30 unmodified lines3132333435363738394041424330 unmodified linestry:resp = requests.post(f"{url}/a2a/jsonrpc", json=payload, timeout=90)data = resp.json()# Check if task failedstate = data.get("result", {}).get("status", {}).get("state", "")if state == "failed":parts = data.get("result", {}).get("status", {}).get("message", {}).get("parts", [])err = parts[0].get("text", "") if parts else "unknown error"print(f"[error] A2A task failed: {err}", file=sys.stderr)return ""parts = data.get("result", {}).get("status", {}).get("message", {}).get("parts", [])for p in parts:if p.get("kind") == "text" or p.get("type") == "text":
562 unmodified lines563564565566567568569570571572573574575576577578579580581582583584585586587588562 unmodified linesprint("[SYNC] Config patched and saved.")# Fix paired devices scopes (OpenClaw 2026.2.19+ requires operator.write/read)paired_path = Path(OPENCLAW_DIR) / "devices" / "paired.json"required_scopes = {"operator.admin", "operator.approvals", "operator.pairing", "operator.write", "operator.read"}if paired_path.exists():try:with open(paired_path, "r") as f:devices = json.load(f)changed = Falseif isinstance(devices, list):for dev in devices:if isinstance(dev, dict) and "scopes" in dev:existing = set(dev["scopes"])if not required_scopes.issubset(existing):dev["scopes"] = list(required_scopes | existing)changed = Trueif changed:with open(paired_path, "w") as f:json.dump(devices, f, indent=2)print(f"[SYNC] Fixed paired device scopes: added operator.write/read")except Exception as e:print(f"[SYNC] Warning: could not fix paired devices: {e}")# Verify writewith open(config_path, "r") as f:562 unmodified lines563564565566567568569570571572573574562 unmodified linesprint("[SYNC] Config patched and saved.")# Fix paired devices scopes (OpenClaw 2026.2.19+ requires operator.write/read)# Delete old paired devices to force fresh auto-pair with correct scopesdevices_dir = Path(OPENCLAW_DIR) / "devices"if devices_dir.exists():import shutilshutil.rmtree(devices_dir, ignore_errors=True)print("[SYNC] Deleted devices/ dir to force fresh auto-pair with operator.write/read scopes")# Verify writewith open(config_path, "r") as f:
Dockerfile+1-1
scripts/conversation-loop.py+7
scripts/sync_hf.py+6-20