agentleFS
thoitiettxl-cyberthoitiettxl-cyber/Claw-II/skills/gateway-device-pairing/SKILL.md

gateway-device-pairing

Skill2 starsChanged 7 months agoMITView on GitHub

Standardize the Device Pairing process for Gateway (fix `pairing required` error), clearly distinguish it from channel pairing, and verify operator authority before patching/restarting config.

The file

Show its rules and text

We split this skill into the rules it gives an agent

16 rules. About 0 are common, 7 are distinctive, and 9 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈7

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 9

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Use this skill when one of the following signs appears:

    line 30
  2. Very specific:

    If pairing required is present, run openclaw devices list --json.

    line 48
  3. Very specific:

    If pending is empty, check the wrong profile/runtime (--dev, --profile, other node).

    line 49
  4. Very specific:

    Do not prioritize qr/publicUrl/tailnet if the target only pairs locally on the machine itself.

    line 78
  5. Very specific:

    check /data/adb/openclaw/home/.openclaw/devices/pending.json and paired.json to compare pending.scopes with …

    line 80
  6. Distinctive:

    Only consider patching local auth state backup-first when the command-level line is not enough.

    line 82
  7. Distinctive:

    After approving, it's still unreachable:

    line 83
  8. Very specific:

    Check the correct Gateway port (ws://127.0.0.1:18789 or port override).

    line 85
  9. Very specific:

    Use openclaw devices remove|revoke|rotate according to role/scopes.

    line 87
  10. Very specific:

    Do not approve strange requests without verifying displayName/clientId/platform.

    line 90
  11. Distinctive:

    Do not reveal detailed tokens/scopes in public chat.

    line 91
  12. Distinctive:

    Do not confuse pairing channel with pairing device when handling auth errors.

    line 92
  13. Very specific:

    After pairing successfully, perform config patch/restart/privileged actions.

    line 93
  14. Distinctive:

    If you don't see a pending request: clearly distinguish whether there is no real request or you are confusing device pairing with channel …

    line 104
  15. Distinctive:

    If approval fails due to operator permissions: stop at the verify role/permissions step instead of continuing to patch the config blindly.

    line 105
  16. Very specific:

    If pair is done but error persists: switch to triage config/runtime with evidence from devices pending/approve/status.

    line 106

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Gateway Device Pairing

Scope

  • In-scope: pairing/triage Gateway device according to skill workflow, distinguish device pairing from channel pairing, verify operator permission before patch/restart.
  • Out-of-scope: channel pairing or mutation runtime outside of scope pairing without approval.

Indexed Reference Map

  • @[SKILL.md#L1-L108] Standard Frontmatter (name, description).
  • @[SKILL.md#L6-L108] Device Pairing process for Gateway.
  • @[SKILL.md#L8-L108] Target.
  • @[SKILL.md#L14-L108] When to activate skill.
  • @[SKILL.md#L21-L108] Distinguish between two types of pairing.
  • @[SKILL.md#L32-L108] Standard SOP (diagnose → approve → verify).
  • @[SKILL.md#L58-L108] Troubleshooting nhanh.
  • @[SKILL.md#L81-L108] Guardrails are safe.
  • @[references/runbook.md#L1-L104] Copy/paste sample command for each situation.

Target

Standardize the operation when Gateway denies access with error pairing required, so that future models do not confuse:

  • Device pairing of Gateway auth
  • Pairing theo channel (Telegram DM allowlist)

When to activate skills?

Use this skill when one of the following signs appears:

  • Tool gateway error gateway closed (1008): pairing required
  • openclaw status reports Gateway unreachable because pairing is required
  • openclaw devices list returns pending request to approve

Distinguish between 2 types of pairing (required)

  1. Gateway device pairing
    • Main command: openclaw devices list|approve
    • Effect: grant trust + token/scopes to CLI/device calling Gateway API.
  2. Channel pairing (eg Telegram DM)
    • Main command: openclaw pairing list|approve
    • Effect: Control who can message bots in DM/group according to policy channel.

Conclusion: Gateway's pairing required error is not handled by openclaw pairing ... if pending is in devices.

Standard SOPs

Step 1 — Diagnose the correct layer

  1. Run openclaw status.
  2. If pairing required is present, run openclaw devices list --json.
  3. If pending is empty, check the wrong profile/runtime (--dev, --profile, other node).

Step 2 — Approve device pending

  1. Latest Approve:
    openclaw devices approve --latest --json
  2. Or approve by request id:
    openclaw devices approve <requestId> --json

Step 3 — Verify required

  1. openclaw devices list --json → the approved request is no longer in pending.
  2. openclaw status → Gateway must switch to reachable.
  3. Try a real Gateway command (e.g. gateway config.get) to confirm operation.

Troubleshooting nhanh

  • devices list still reports pairing required but has JSON pending:
    • can still approve; Prioritize checking JSON output device.approvedScopes.
  • Thực chiến (2026-03-27, Android local loopback): openclaw devices approve --latest có thể vẫn in gateway connect failed: pairing required ở bước đầu, sau đó chuyển sang Direct scope access failed; using local fallback. và vẫn Approved <deviceId> (<requestId>) thành công.
    • Không kết luận fail chỉ vì thấy dòng pairing required trong cùng lần approve.
    • Luôn verify hậu kiểm: openclaw status phải báo Gateway reachable (auth token) và thử openclaw logs --limit 30 --plain để xác nhận RPC đã dùng được.
  • App reports unauthorized: gateway token missing (provide gateway auth token) on local route http://127.0.0.1:18789:
    • classify is pairing/auth, not TLS or gateway down.
    • The app reached the correct local gateway but was blocked at the auth layer before onboarding was completed.
    • devices list at this time may not be pending; Only when the app re-emit request is successful will the actual pending appear.
  • Same-machine Android (gateway + app on same phone):
    • direct local route priority 127.0.0.1:18789, TLS OFF.
    • Do not prioritize qr/publicUrl/tailnet if the target only pairs locally on the machine itself.
  • Pending request requires a wider scope than the current operator (eg operator.talk.secrets) and approval fails/does not appear:
    • check /data/adb/openclaw/home/.openclaw/devices/pending.json and paired.json to compare pending.scopes with approvedScopes/tokens.operator.scopes.
    • Formal remediation first: openclaw devices rotate --device <id> --role operator --scope ... to extend the token in the approved baseline.
    • Only consider patching local auth state backup-first when the command-level line is not enough.
  • After approving, it's still unreachable:
    • mistakenly checked runtime/profile (openclaw --dev ... vs default).
    • Check the correct Gateway port (ws://127.0.0.1:18789 or port override).
  • Need to recall old equipment:
    • Use openclaw devices remove|revoke|rotate according to role/scopes.

Guardrails are safe

  • Do not approve strange requests without verifying displayName/clientId/platform.
  • Do not reveal detailed tokens/scopes in public chat.
  • Do not confuse pairing channel with pairing device when handling auth errors.
  • After pairing successfully, perform config patch/restart/privileged actions.

Expected results

Later models can correctly identify the pairing required error, run the correct flow devices approve, verify and then safely operate the Gateway config.

Trigger Rules

  • Positive: Activate when the user request matches gateway-device-pairing according to description: Standardize the Device Pairing process for Gateway (fix pairing required error), clearly distinguish it from channel pairing, and verify operator authority before patching/restarting config.
  • Negative: Not enabled for requests outside scope or without the workflow/expertise of this skill.
  • Escalation: If there is an external action/network write or sensitive operation, an approval checkpoint must be added before executing.

Error Handling

  • If you don't see a pending request: clearly distinguish whether there is no real request or you are confusing device pairing with channel pairing.
  • If approval fails due to operator permissions: stop at the verify role/permissions step instead of continuing to patch the config blindly.
  • If pair is done but error persists: switch to triage config/runtime with evidence from devices pending/approve/status.

Output Contract

  • Deliverable: target tracking result of gateway-device-pairing; Specify the artifact/path/steps performed (if any).
  • Validation: reports PASS/FAIL status and main checks have been run.
  • Failure mode: when there is an error, the root cause + proposed fix must be stated.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.