gateway-proxy-debug

oleh vercel

Debug gateway dan proxy untuk vercel-openclaw: routing /gateway, injeksi HTML, penulisan ulang WebSocket, serah terima gateway-token, halaman tunggu, detak jantung status,…

npx skills add https://github.com/vercel-labs/vercel-openclaw --skill gateway-proxy-debug

Gateway Proxy Debug

Use this skill when the wrapper can reach a sandbox but /gateway, HTML injection, WebSockets, or token handoff is broken.

Evidence First

Collect:

  • Browser URL and failing request path.
  • GET /api/status.
  • GET /api/admin/sandbox-diag.
  • GET /api/admin/logs filtered for proxy., gateway., sandbox.port_, token..
  • Network trace for /gateway/*, WebSocket upgrade, and POST /api/status heartbeat.

Keep app auth, deployment protection bypass, gateway token, and AI Gateway auth separate. Do not paste gateway tokens in artifacts.

Path Diagram

browser -> wrapper auth -> /gateway route -> ensure sandbox running
  -> fresh gateway token -> sandbox port URL -> OpenClaw gateway
  -> HTML injection -> WebSocket rewrite -> heartbeat POST /api/status

Mark each edge unknown, verified-good, or verified-bad.

Common Failure Splits

  • Waiting page is correct because sandbox is not ready yet.
  • Proxy auth failed before any sandbox request.
  • Cached port URL is stale and needs invalidation.
  • Gateway token is stale or not injected.
  • HTML injection failed or produced a malformed script.
  • WebSocket URL rewrite points at the wrong origin/path.
  • Heartbeat is missing and sandbox times out.

Fix Boundaries

  • Primary: src/app/gateway/[[...path]]/route.ts.
  • Helpers: src/server/proxy/{proxy-route-utils,htmlInjection,waitingPage}.ts.
  • Lifecycle dependencies: src/server/sandbox/lifecycle.ts, src/server/public-url.ts.
  • Tests: proxy/html injection tests plus lifecycle tests for heartbeat interactions.
  • Docs: lat.md/sandbox-lifecycle.md, docs/architecture.md, docs/deployment-protection.md.

Verification

Run focused tests when available, then:

node scripts/verify.mjs --steps=test,typecheck
lat check

For UI/WebSocket fixes, verify in a browser or with a smoke check that HTML contains the injected script and WebSocket traffic reaches the sandbox.

Lebih banyak skill dari vercel

benchmark-sandbox
vercel
Jalankan skenario evaluasi vercel-plugin di Vercel Sandbox, bukan di panel WezTerm lokal. Menyediakan microVM sementara dengan Claude Code + plugin yang sudah terinstal sebelumnya,…
official
emil-design-eng
vercel
Skill ini mengodekan filosofi Emil Kowalski tentang polesan UI, desain komponen, keputusan animasi, dan detail tak terlihat yang membuat perangkat lunak terasa hebat.
official
vercel-react-best-practices
vercel
Panduan optimasi performa React dan Next.js dari Vercel Engineering. Skill ini harus digunakan saat menulis, meninjau, atau merefaktor kode React/Next.js…
official
vercel-react-best-practices
vercel
Panduan optimasi performa React dan Next.js dari Vercel Engineering. Skill ini harus digunakan saat menulis, meninjau, atau merefaktor kode React/Next.js…
official
write-guide
vercel
Hasilkan panduan teknis yang mengajarkan kasus penggunaan dunia nyata melalui contoh-contoh progresif. Konsep diperkenalkan hanya saat pembaca membutuhkannya.
official
release
vercel
Release vercel-plugin — jalankan gates, naikkan versi, hasilkan artefak, commit, dan push. Gunakan saat diminta untuk "release", "ship", "bump and push", atau "cut a release".
official
deepsec
vercel
Jalankan DeepSec terhadap pemeriksaan proyek Vercel dari dev3000. Gunakan untuk pengaturan DeepSec satu klik, bootstrap konteks proyek, pemrosesan awal terbatas, dan…
official
backport-pr
vercel
Melakukan backport pull request Next.js yang sudah digabung dari canary ke cabang rilis sebelumnya seperti next-16-2. Gunakan saat pengguna meminta untuk backport, cherry-pick, atau membuka…
official