feat: wire up streamEvents and add events array to message model#603
Merged
Conversation
- proposal.md: Why, What Changes, Capabilities, Impact - design.md: Context, Goals/Non-Goals, Decisions, Risks - specs/tui-streaming/spec.md: 9 requirements with scenarios - tasks.md: 6 task groups, 17 checkboxes
- Add events field to Message typedef (messages.js) - Update addMessage/setMessages to pass through events (messageList.js) - Pass events to MessageBubble in render loop (messageList.js) - Update createStreamingHandler to capture all event types (app.js) - Handle on_chat_model_stream, on_tool_start/end/error events - Populate activeToolCall, toolCallDisplay, reasoningContent from events - Update all createStreamingHandler call sites with new params
- Moved wire-up-streamevents-message-model to archive - Created tui-streaming spec from change artifacts
Owner
Author
Audit Results: wire-up-streamevents-message-modelGoal Fulfillment
Spec Compliance
Task Completion
Quality Check
Deviations from Plan
SummaryAll goals fulfilled, all specs implemented, all tasks complete. No issues found. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Wire up LangChain
streamEventsin the TUI streaming pipeline — capture all event types and store them on the message model so the TUI can render rich event data (tool calls, agent actions, chain events, reasoning, etc.).What was implemented
Message Model (
src/tui/messages.js):eventsfield to Message typedef — stores raw stream eventsMessageList (
src/tui/messageList.js):addMessageaccepts and storeseventsin optionssetMessagespasseseventsfrom source messageseventsto MessageBubble componentStreaming Handler (
src/tui/app.js):createStreamingHandlernow acceptscommittedReasoningRefandlastToolCallDisplayRefparameterseventsarrayon_chat_model_stream— accumulates content and reasoning from chunkon_tool_start— setsactiveToolCallwith name, input, statuson_tool_end— clearsactiveToolCall, setstoolCallDisplayon_tool_error— setsactiveToolCallwith name, error, statusRendering
Rendering event data in MessageBubble is intentionally out of scope — the plumbing captures and stores all events; rendering is a separate concern.
Type of Change
Testing
Coverage
Checklist
npm run lintpasses