Skip to content

docs(gateway): add client-building and embedding guides#111726

Merged
steipete merged 2 commits into
mainfrom
claude/gateway-docs
Jul 20, 2026
Merged

docs(gateway): add client-building and embedding guides#111726
steipete merged 2 commits into
mainfrom
claude/gateway-docs

Conversation

@steipete

Copy link
Copy Markdown
Contributor

What Problem This Solves

Three independent third-party clients (ClawX, openclaw-studio, PinchChat) reverse-engineered the Gateway protocol and embedder lifecycle from source because the contracts they needed were undocumented. With @openclaw/gateway-protocol (#111664) and @openclaw/gateway-client (#111707) shipping to npm at the next train, this adds the docs that make those packages usable without reading our internals.

Why This Change Was Made

  • New docs/gateway/clients.md — Building a Gateway client: npm install, scopes + device pairing, the caps registry (incl. tool-events gating live tool streaming), the canonical reconnect recipe (chat.history + inFlightRun + per-run seq), __openclaw history-row metadata and compaction-survivable anchors, sessions.changed push-not-poll, exec.approval.list backfill, and the honest version policy (operator exact-v4, node N-1, additive-first, since vintage).
  • New docs/gateway/embedding.md — Embedding OpenClaw: env preset with per-flag effects (incl. the Electron process.execPath snapshot popup), exit code 78 doctor-repair loop instead of stderr scraping, connect.challenge (socket) vs hello-ok (application) readiness, 1013 startup-sidecars retry contract, shutdown event restartExpectedMs as the real restart-vs-shutdown discriminator (close code 1012 is shared), and RPC-not-state-files guidance.
  • docs/gateway/protocol.md + external-apps.md link the npm packages; nav registered in docs/docs.json.
  • Every cited env var, exit code, close code, cap, and method name grep-verified against current source; outline claims that didn't survive verification were corrected, not shipped.

User Impact

Docs-only. Third-party client and embedder developers get supported, verified contracts instead of source archaeology.

Evidence

  • pnpm docs:list shows both pages; MDX 747 files pass; link check 6,145 links 0 broken; formatting clean; docs.json valid; git diff --check clean. Verification greps included in the internal build report.

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation gateway Gateway runtime size: XS maintainer Maintainer-authored PR labels Jul 20, 2026
@steipete steipete self-assigned this Jul 20, 2026
@steipete
steipete force-pushed the claude/gateway-docs branch from ce02c73 to 779bacf Compare July 20, 2026 08:14
@steipete

Copy link
Copy Markdown
Contributor Author

ClawSweeper rank-up move addressed: Gateway-contract owner verification is complete on exact head 779bacf.

The package manifests and release wiring, capability/version contracts, reconnect and history projection, startup readiness/retry behavior, shutdown/restart semantics, embedding environment flags, and RPC ownership guidance were checked against current main. Review-driven corrections now document the initial npm rollout, resolve the installed OpenClaw entry explicitly, require a real host-managed Node runtime, and prevent unconsumed child output pipes.

Proof: the full docs gate passes (747 MDX files; 6,145 links, 0 broken; glossary and docs map current), follow-up autoreview is clean, and exact-head CI run 29727227950 is green through openclaw/ci-gate. No ClawSweeper findings or remaining rank-up moves.

@steipete
steipete merged commit 9056c43 into main Jul 20, 2026
47 checks passed
@steipete
steipete deleted the claude/gateway-docs branch July 20, 2026 09:12
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Jul 21, 2026
)

* docs(gateway): add client-building and embedding guides

* docs(gateway): harden package rollout guidance
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs Improvements or additions to documentation gateway Gateway runtime maintainer Maintainer-authored PR size: XS

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant