Skip to content

feat(06): Streaming chat and agent UI - #48

Open
tpaulshippy wants to merge 6 commits into
mainfrom
feature/roadmap-06-streaming-chat
Open

feat(06): Streaming chat and agent UI#48
tpaulshippy wants to merge 6 commits into
mainfrom
feature/roadmap-06-streaming-chat

Conversation

@tpaulshippy

@tpaulshippy tpaulshippy commented Aug 25, 2026

Copy link
Copy Markdown
Owner

Roadmap 06: Streaming Chat & Agent UI

Implements #58.

What changed

  • Backend: SSE streaming endpoint (POST /api/chats/{id}/stream), respond_events generator, partial text save on disconnect, fake AI client for e2e (e2e-fake-stream model)
  • Frontend: createSseParser (chunk-boundary-safe), growing assistant bubble, Stop button, agent-activity chips (deck/search/sources), deck-created toast → Study now
  • Transport: SSE over plain Django StreamingHttpResponse (no new infra needed)
  • Tests: 91 backend (9 new), 61 frontend, e2e walkthrough

Evidence

Streaming Chat screenshot

https://github.com/tpaulshippy/bots/raw/feature/roadmap-06-streaming-chat/evidence/pr48-streaming.mp4

tpaulshippy and others added 5 commits August 25, 2026 11:32
…s[] (docs/roadmap/06-streaming-chat-and-agent-ui.md)

- ChatAgentService: client_events accumulation + respond_events() generator
  (token / tool_start / tool_end / done) buffering tool-call chunks
- Chat.stream_response(): persists assistant message on done AND partial text
  on disconnect (doc 06 §2 'prefer save partial'); over_limit -> single error
- POST /api/chats/<id>/stream (plain Django StreamingHttpResponse, no
  channels): meta/status/token/done/error frames per doc 06 §1
- Legacy POST gains optional events[] (flashcard_deck_created) per doc 06 §3
- FakeStreamingClient + seed_e2e_streaming_chat: deterministic demo/e2e path
  with no AWS credentials
- api/chats.ts: createSseParser + normalizeStreamEvent (chunk-safe, unit
  tested) and streamChatMessage() using fetch+ReadableStream per doc 06 §1,
  with XHR progress fallback for RN FormData image parts; AbortSignal cancel
- botChat.tsx: sending/streaming/error state machine, growing assistant
  bubble, Stop button (testID stop-button), Retry on failed send, light
  haptic on deck creation, VoiceOver 'Bot is typing' announcement
- ChatMessage.tsx: agent-activity chips (searching/deck/sources) + retry
- deck toast 'N cards in <name>' with Study now CTA -> /flashcards/deck
- e2e/06-streaming-chat.e2e.js: seeded fake-stream walk (progressive tokens,
  tool chip, toast, study deep link) + cancel-mid-stream keeps bubble
tpaulshippy pushed a commit that referenced this pull request Aug 26, 2026
Screenshot shows the chat screen with message input and camera/send buttons.
Screenshot shows the chat screen with message input and camera/send buttons.
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