feat: stream Reginald's replies token-by-token #49
Reference in New Issue
Block a user
No description provided.
Delete Branch "feat/streaming-chat"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
The 26b is slow (~30s/call); the chat now shows the answer forming instead of freezing until it's done. The final prose streams over SSE; tool-calling turns stay structured (no partial tokens), so streaming kicks in for the narration.
Core (
@commitea/core)chat-client.complete(messages, tools, onToken?)— withonToken, requestsstream: trueand parses the OpenAI SSE stream: emits content deltas and assembles streamed tool-call argument fragments into the finalCompletionResult.GiteaHttpResponseexposes the optionalbodystream (real fetch has it; stubs don't).agent-loopthreadsonTokento each completion.App
model:chatforwards each delta to the renderer (event.sender.send); preload exposesmodel.onToken(cb)→ unsubscribe.useChataccumulates the live stream into a growing bubble (with a cursor), replaced by the authoritative final content when the turn resolves. Unconfigured → scripted reply, unchanged.Verified
118 core tests green (2 streaming: SSE content deltas + tool-call fragment assembly) · desktop typecheck clean · 14 fixture e2e green. Live: a real turn against
gemma-4-26bassembles the correct answer via the streaming path (live-reginaldgreen) — the reply renders token-by-token.Note: streaming doesn't make the model faster; it replaces the ~60s freeze with visible progress.
🤖 Generated with Claude Code