docs(site): refresh clawdis.ai for Pi
This commit is contained in:
@@ -111,7 +111,7 @@ Goal: replace legacy gateway/stdin/TCP control with a single WebSocket Gateway,
|
||||
## Phase 6 — Send/agent path hardening
|
||||
- Ensure only the Gateway can open Baileys; no IPC fallback.
|
||||
- `send` executes in-process; respond with explicit result/error, not via heartbeat.
|
||||
- `agent` spawns Tau/Pi; respond quickly with `{runId,status:"accepted"}` (ack); stream `event:agent {runId, seq, stream, data, ts}`; final `res:agent {runId, status:"ok"|"error", summary}` completes request (idempotent via key).
|
||||
- `agent` spawns Pi; respond quickly with `{runId,status:"accepted"}` (ack); stream `event:agent {runId, seq, stream, data, ts}`; final `res:agent {runId, status:"ok"|"error", summary}` completes request (idempotent via key).
|
||||
- Idempotency: side-effecting methods (`send`, `agent`) accept an idempotency key; keep a short-lived dedupe cache to avoid double-send on client retries. Client retry flow: on timeout/close, retry with same key; Gateway returns cached result when available; cache TTL ~5m and bounded.
|
||||
- Agent stream ordering: enforce monotonic `seq` per runId; if gap detected by server, terminate stream with error; if detected by client, issue a retry with same idempotency key.
|
||||
- Send response shape: `{messageId?, toJid?, error?}` and always include `runId` when available for traceability.
|
||||
|
||||
@@ -6,18 +6,17 @@ read_when:
|
||||
# Web Gateway Troubleshooting (Nov 26, 2025)
|
||||
|
||||
## Symptoms & quick fixes
|
||||
- **Stream Errored / Conflict / status 409–515:** WhatsApp closed the socket because another session is active or creds went stale. Run `clawdis logout` then `clawdis login --provider web` and restart the gateway.
|
||||
- **Logged out:** Console prints “session logged out”; re-link with `clawdis login --provider web`.
|
||||
- **Repeated retries then exit:** Reconnects are capped (default 12 attempts). Tune with `--web-retries`, `--web-retry-initial`, `--web-retry-max`, or config `web.reconnect`.
|
||||
- **Stream Errored / Conflict / status 409–515:** WhatsApp closed the socket because another session is active or creds went stale. Run `clawdis logout`, then `clawdis login`, then restart the Gateway.
|
||||
- **Logged out:** Console prints “session logged out”; re-link with `clawdis login`.
|
||||
- **Repeated retries then exit:** Tune reconnect behavior via config `web.reconnect` and restart the Gateway.
|
||||
- **No inbound messages:** Ensure the QR-linked account is online in WhatsApp, and check logs for `web-heartbeat` to confirm auth age/connection.
|
||||
- **Fast nuke:** From an allowed WhatsApp sender you can send `/restart` to kick `com.steipete.clawdis` via launchd; wait a few seconds for it to relink.
|
||||
- **Fast nuke:** From an allowed WhatsApp sender you can send `/restart` to request a supervised restart (launchd/mac app setups); wait a few seconds for it to come back.
|
||||
|
||||
## Helpful commands
|
||||
- Start gateway web-only: `pnpm clawdis gateway --provider web --verbose`
|
||||
- Show who is linked: `pnpm clawdis gateway --provider web --verbose` (first line prints the linked E.164)
|
||||
- Logout (clear creds): `pnpm clawdis logout`
|
||||
- Relink: `pnpm clawdis login --provider web`
|
||||
- Tail logs (default): `tail -f /tmp/clawdis/clawdis.log`
|
||||
- Start the Gateway: `clawdis gateway --verbose`
|
||||
- Logout (clear creds): `clawdis logout`
|
||||
- Relink (show QR): `clawdis login --verbose`
|
||||
- Tail logs (default): `tail -f /tmp/clawdis/clawdis-*.log`
|
||||
|
||||
## Reading the logs
|
||||
- `web-reconnect`: close reasons, retry/backoff, max-attempt exit.
|
||||
@@ -25,12 +24,12 @@ read_when:
|
||||
- `web-auto-reply`: inbound/outbound message records with correlation IDs.
|
||||
|
||||
## When to tweak knobs
|
||||
- High churn networks: increase `web.reconnect.maxAttempts` or `--web-retries`.
|
||||
- Slow links: raise `--web-retry-max` to give more headroom before bailing.
|
||||
- Chatty monitors: increase `--web-heartbeat` interval if log volume is high.
|
||||
- High churn networks: increase `web.reconnect.maxAttempts`.
|
||||
- Slow links: raise `web.reconnect.maxMs` to give more headroom before bailing.
|
||||
- Chatty monitors: increase `web.heartbeatSeconds` if log volume is high.
|
||||
|
||||
## If it keeps failing
|
||||
1) `clawdis logout` → `clawdis login --provider web` (fresh QR link).
|
||||
1) `clawdis logout` → `clawdis login` (fresh QR link).
|
||||
2) Ensure no other device/browser is using the same WA Web session.
|
||||
3) Check WhatsApp mobile app is online and not in low-power mode.
|
||||
4) If status is 515, let the client restart once after pairing (already handled automatically).
|
||||
|
||||
@@ -1,3 +1,9 @@
|
||||
---
|
||||
summary: "WebChat session migration notes (Gateway WS-only)"
|
||||
read_when:
|
||||
- Changing WebChat Gateway methods/events
|
||||
---
|
||||
<!-- {% raw %} -->
|
||||
# WebAgent session migration (WS-only)
|
||||
|
||||
Context: web chat currently lives in a WKWebView that loads the pi-web bundle. Sends go over HTTP `/rpc` to the webchat server, and updates come from `/socket` snapshots based on session JSONL file changes. The Gateway itself already speaks WebSocket to the webchat server, and Pi writes the session JSONL files. This doc tracks the plan to move WebChat to a single Gateway WebSocket and drop the HTTP shim/file-watching.
|
||||
@@ -37,3 +43,4 @@ Context: web chat currently lives in a WKWebView that loads the pi-web bundle. S
|
||||
- Streaming granularity: start with `state:"final"` only, or include token/tool deltas immediately?
|
||||
- Attachments over WS: text-only initially is OK; confirm before wiring binary/upload path.
|
||||
- Error shape: use `res ok:false` for validation/timeout, `chat state:"error"` for model/runtime failures.
|
||||
<!-- {% endraw %} -->
|
||||
|
||||
Reference in New Issue
Block a user