.claude/skills/openclaw-post-upgrade-scope-fix/SKILL.md
Fix OpenClaw cron delivery failing with "gateway closed (1008): pairing required" after an OpenClaw npm upgrade. Use when: (1) cron jobs complete their work but "cron announce delivery failed" on the iMessage/delivery step, (2) gateway logs show "pairing required" or code 1008 on WebSocket connections from cron subagents, (3) security audit logs show "scope-upgrade requested" with reason=scope-upgrade, (4) pending.json has an unresolved repair request. Root cause: new OpenClaw versions may require additional device scopes (e.g., operator.write) not present in existing paired device configs.
npx skillsauth add Dbochman/dotfiles openclaw-post-upgrade-scope-fixInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
After upgrading OpenClaw (npm), cron jobs complete their work (e.g., Gmail triage)
but fail at the delivery step with cron announce delivery failed. The gateway
rejects the cron subagent's WebSocket connection with code 1008 ("pairing required").
The error message is misleading — it's not a pairing issue, it's a missing scope.
gateway closed (1008): pairing requiredsecurity audit: device access upgrade requested with reason=scope-upgrade~/.openclaw/devices/pending.json contains a repair request with "isRepair": truessh dbochman@dylans-mac-mini
# Check for pending scope repair requests
cat ~/.openclaw/devices/pending.json
# Check current device scopes
cat ~/.openclaw/devices/paired.json | jq '.[] | {scopes, tokenScopes: .tokens.operator.scopes}'
# Check runtime logs for scope-upgrade requests
grep "scope-upgrade" /tmp/openclaw/openclaw-$(date +%Y-%m-%d).log
# Backup first
cp ~/.openclaw/devices/paired.json ~/.openclaw/devices/paired.json.bak
cp ~/.openclaw/devices/pending.json ~/.openclaw/devices/pending.json.bak
# Add the missing scope (e.g., operator.write) to BOTH arrays:
# 1. The device's top-level "scopes" array
# 2. The device's "tokens.operator.scopes" array
# Use jq or careful manual editing
# Example with jq (adjust device ID key as needed):
DEVICE_KEY=$(cat ~/.openclaw/devices/paired.json | jq -r 'keys[0]')
jq ".[\"$DEVICE_KEY\"].scopes += [\"operator.write\"] | .[\"$DEVICE_KEY\"].tokens.operator.scopes += [\"operator.write\"]" \
~/.openclaw/devices/paired.json > /tmp/paired-fixed.json && \
mv /tmp/paired-fixed.json ~/.openclaw/devices/paired.json
# Clear the pending repair request
echo '{}' > ~/.openclaw/devices/pending.json
launchctl bootout gui/$(id -u) ~/Library/LaunchAgents/ai.openclaw.gateway.plist
sleep 3
launchctl bootstrap gui/$(id -u) ~/Library/LaunchAgents/ai.openclaw.gateway.plist
sleep 5
# Verify
launchctl list | grep openclaw.gateway
tail -20 ~/.openclaw/logs/gateway.log
set -a && source ~/.openclaw/.secrets-cache && set +a
PATH=/opt/homebrew/bin:/opt/homebrew/opt/node@22/bin:$PATH \
openclaw cron run weekly-upgrade-verify-0001 --timeout 300000 --expect-final
Use any cron job that delivers to Dylan for testing. Returns {"ok":true,"ran":true} on success.
launchctl list | grep openclaw.gateway shows a PIDopenclaw cron run completes delivery successfullycron announce delivery failed| File | Purpose |
|------|---------|
| ~/.openclaw/devices/paired.json | Device scopes and tokens |
| ~/.openclaw/devices/pending.json | Pending scope-upgrade repair requests |
| ~/.openclaw/logs/gateway.log | Gateway connection logs |
| /tmp/openclaw/openclaw-YYYY-MM-DD.log | Runtime logs with security audit entries |
operator.write as a required scope for cron announce deliverypending.json after upgradespaired.json scopes, check pending.jsondevelopment
Search the web for current information, news, facts, and answers. Use when asked questions about current events, needing to look something up, finding websites, researching topics, or when you need up-to-date information beyond your training data.
development
Summarize any URL, YouTube video, podcast, PDF, or file into concise text. Use when asked to read an article, summarize a link, get the gist of a video or podcast, extract content from a URL, or when you need to understand what a web page or document contains.
development
Play music via Spotify and control Google Home speakers. Use when asked to play music, songs, artists, playlists, podcasts, or control speakers/volume/audio.
testing
Create new OpenClaw skills, modify and improve existing skills, and measure skill performance with evals. Use when users want to create a skill from scratch, update or optimize an existing skill, run evals to test a skill, benchmark skill performance with variance analysis, or optimize a skill's description for better triggering accuracy. Also use when asked to "make a skill", "turn this into a skill", "improve this skill", or "test this skill".