feat: stream mode for chain execution#40
Open
vekexasia wants to merge 3 commits intonicobailon:mainfrom
Open
Conversation
…idget - Add stream mode for chains (--stream flag, [v]iew toggle in TUI) - Render subagent messages using AssistantMessageComponent and ToolExecutionComponent from pi-coding-agent for main-chat look - Display thinking blocks with italic thinkingText styling via Markdown - Show tool calls with proper backgrounds, syntax highlighting, and diffs - Add chain status sticky widget with blinking progress indicator - Add 500ms refresh interval to keep widget animation/timer live - Track combined results in interval for running step timer visibility - Extract thinking content blocks in getDisplayItems for chronological display - Add formatToolCallThemed with toolTitle/accent colors matching pi-mono
- Thread expanded state from renderResult options through to inner ToolExecutionComponent instances so ctrl+o toggles expansion - Fix sequential step onUpdate missing streamResults assignment, causing the widget timer to disappear between update callbacks
Author
|
You can see in action stream mode here : https://drive.google.com/file/d/1z_eC-vxl_u9N7otjty_CTCVEeqYRThvB/view?usp=drive_link |
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.
Summary
AssistantMessageComponentandToolExecutionComponent, matching the main chat look instead of showing a compact summary.✓ scout 12s → ● planner 3s → ○ workerstreamtool parameter,--streamCLI flag on/chain,vtoggle in chain clarify TUI, andstreamModeByDefaultglobal config flag (defaults totrue).Files changed
types.tsstreamonDetails,streamModeByDefaultonExtensionConfig,CHAIN_STATUS_WIDGET_KEY,thinkingdisplay itemschemas.tsstreamboolean tool parameterindex.tsextractBgFlag→extractFlags(supports--stream), reads config, passes stream to chainchain-execution.tsstream, manages status widget lifecycle, propagates in progress updateschain-clarify.tsvkeybinding toggle,initialStreamparam,streamin resultrender.tsrenderStreamMode(),buildChainStatusLine(), widget helpersformatters.tsformatToolCallThemed()for colored tool renderingutils.tsgetDisplayItems()includesthinkingpartsTest plan
/chain scout "task" -> planner— should stream by default/chain scout "task" -> planner --stream— explicit stream flagvin clarify TUIstreamModeByDefault: falsein config and verify compact view is default