Skip to content

Stream web chat responses token-by-token over WebSocket - #74

Merged
arefbehboudi merged 8 commits into
mainfrom
feature/web-chat-streaming
Jul 28, 2026
Merged

Stream web chat responses token-by-token over WebSocket#74
arefbehboudi merged 8 commits into
mainfrom
feature/web-chat-streaming

Conversation

@arefbehboudi

@arefbehboudi arefbehboudi commented Jul 26, 2026

Copy link
Copy Markdown
Collaborator

The agent response for the web chat is now streamed as it is generated instead of arriving as one complete message.

…atsApp Web linked device. JavaClaw supervises wacli sync as a subprocess and receives inbound messages over a local webhook, replying with wacli send.

WacliSyncSupervisor: launches and restarts the sync subprocess with exponential backoff and health-based retry reset.
WhatsAppWebhookController: handles inbound webhooks, gates on the allowed chat JID, and processes messages off the request thread.
WacliWhatsAppChannel: sends replies and suppresses echoes of the agent's own outbound messages by message ID.
WhatsAppOnboardingProvider: onboarding step for install/pair/config.
Wire the plugin into the build and document setup in the README.
The agent response for the web chat is now streamed as it is generated
instead of arriving as one complete message. DefaultAgent gained a
streaming respondTo variant that uses ChatClient.stream() and reports
progress through a new ResponseListener callback (onToken/onComplete/
onError), falling back to the blocking call for models that cannot
stream. ChatChannel supplies a listener that pushes uniform JSON frames
({type: chunk|done|error, data, conversationId}) to the WebSocket
session, and the frontend assembles chunk frames into a live message
bubble while htmx keeps handling the existing HTML frames unchanged.
Messages buffered while no session is active are flushed on reconnect.
Telegram, Discord and WhatsApp channels are unaffected.
The agent response for the web chat is now streamed as it is generated
instead of arriving as one complete message. DefaultAgent gained a
streaming respondTo variant that uses ChatClient.stream() and reports
progress through a new ResponseListener callback (onToken/onComplete/
onError), falling back to the blocking call for models that cannot
stream. ChatChannel supplies a listener that pushes uniform JSON frames
({type: chunk|done|error, data, conversationId}) to the WebSocket
session, and the frontend assembles chunk frames into a live message
bubble while htmx keeps handling the existing HTML frames unchanged.
Messages buffered while no session is active are flushed on reconnect.
Telegram, Discord and WhatsApp channels are unaffected.
@arefbehboudi
arefbehboudi merged commit 298a130 into main Jul 28, 2026
1 check passed
@arefbehboudi
arefbehboudi deleted the feature/web-chat-streaming branch July 28, 2026 05:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant