ClawBox Chat Stream
Use this skill when the task involves ClawBox chat flow, assistant streaming, tool event rendering, session history hydration, or title generation.
Read first
src/hooks/useChat.tssrc/services/ai.tssrc/store/chat.tssrc/components/chat/internal/routes/chat.tsinternal/providers/openclaw-rpc.tssrc/services/api.ts
Workflow
- Map the end-to-end path: UI event -> frontend store/hook -> SSE parser -> backend route -> OpenClaw RPC event.
- If request or response payloads change, update every consumer in the same task instead of leaving cross-layer drift.
- For tool-call regressions, verify both streamed events and history rehydration. ClawBox uses live events plus follow-up history reconciliation.
- For title or unread-count issues, inspect the
finallypath insrc/hooks/useChat.tsand the corresponding Zustand store updates.
Verification
- Run
npm run build:frontend. - Run
npm run build:backend. - If the local gateway is available, use
bun test/openclaw-stream.ts --prompt "..."as a manual smoke test.
Guardrails
- Never guess OpenClaw protocol fields or event names.
- Preserve the SSE event types expected by
src/services/ai.ts. - Keep message block ordering consistent with the
text,reasoning, andtool_callmodel.