You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(kiloclaw): integrate Stream Chat for real-time messaging (#1573)
## Summary
- Integrate Stream Chat as a real-time messaging channel for KiloClaw
instances. On first provision, the DO auto-creates a Stream Chat bot
user, human user, and default messaging channel via the Stream Chat REST
API (lightweight `jose`-based JWT auth, no Node SDK dependency for CF
Workers compatibility).
- Add a new `ChatTab` React component to the KiloClaw dashboard using
`stream-chat-react`, with bot online/offline presence indicator and dark
theme styling.
- Wire Stream Chat credentials through the full stack: DO persisted
state, config-writer (OpenClaw plugin + channel config), env vars
(sensitive bot token encrypted in transit), platform API route, tRPC
router, and React hook.
- Update both Dockerfiles to install the `openclaw-channel-streamchat`
plugin from a GitHub fork
(https://github.com/Kilo-Org/openclaw-channel-streamchat/tree/catrielmuller/attach-support).
## Verification
- [x] `pnpm format:check` passes
- [x] `pnpm lint` passes across all
workspaceshttps://github.com/Kilo-Org/openclaw-channel-streamchat/tree/catrielmuller/attach-support
- [x] `pnpm typecheck` passes for root project and kiloclaw workspace
(pre-existing cloud-agent-next drizzle-orm type errors are unrelated,
also present on main)
- [x] Stream Chat client unit tests exist
(`kiloclaw/src/stream-chat/client.test.ts` — covers JWT generation,
upsertUsers, getOrCreateChannel, and full setupDefaultStreamChatChannel
flow)
- [x] Config-writer tests exist
(`kiloclaw/controller/src/config-writer.test.ts` — covers Stream Chat
channel configuration, missing env vars, and plugin path deduplication)
## Visual Changes
<img width="2239" height="1359" alt="image"
src="https://github.com/user-attachments/assets/4dfc5f83-6916-493d-ac21-44cdc335f11d"
/>
<img width="2261" height="1290" alt="image"
src="https://github.com/user-attachments/assets/69780f7e-f2c0-4091-83b7-4bff0514d174"
/>
<img width="2277" height="1621" alt="image"
src="https://github.com/user-attachments/assets/4f1cc7a9-fb62-493a-8976-15b471e1e502"
/>
<img width="2277" height="1621" alt="image"
src="https://github.com/user-attachments/assets/a97a05b4-8ec5-44a8-9711-4226816c87cd"
/>
## Reviewer Notes
- The Stream Chat API secret never reaches Fly Machines — all admin
operations (user creation, channel creation, token generation) happen
server-side in the CF Worker DO. Only per-user JWTs are forwarded.
- Stream Chat setup is best-effort during provisioning: failure is
logged but does not block instance creation, so existing instances are
unaffected.
- The `openclaw-channel-streamchat` plugin is installed from a GitHub
fork branch (`catrielmuller/attach-support`) — this should be updated to
a stable release before merging to production.
- The `stream-chat` and `stream-chat-react` npm packages are added to
the root `package.json` for the Next.js frontend.
0 commit comments