Skip to content

feat: stream mode for chain execution#40

Open
vekexasia wants to merge 3 commits intonicobailon:mainfrom
vekexasia:feat/stream-mode
Open

feat: stream mode for chain execution#40
vekexasia wants to merge 3 commits intonicobailon:mainfrom
vekexasia:feat/stream-mode

Conversation

@vekexasia
Copy link

Summary

  • Live output rendering for chain execution — step output is rendered inline using pi-mono's AssistantMessageComponent and ToolExecutionComponent, matching the main chat look instead of showing a compact summary.
  • Chain status widget — sticky bottom bar showing chain progress with blinking animation: ✓ scout 12s → ● planner 3s → ○ worker
  • Multiple activation methods: stream tool parameter, --stream CLI flag on /chain, v toggle in chain clarify TUI, and streamModeByDefault global config flag (defaults to true).

Files changed

File Change
types.ts stream on Details, streamModeByDefault on ExtensionConfig, CHAIN_STATUS_WIDGET_KEY, thinking display item
schemas.ts stream boolean tool parameter
index.ts extractBgFlagextractFlags (supports --stream), reads config, passes stream to chain
chain-execution.ts Accepts stream, manages status widget lifecycle, propagates in progress updates
chain-clarify.ts v keybinding toggle, initialStream param, stream in result
render.ts renderStreamMode(), buildChainStatusLine(), widget helpers
formatters.ts formatToolCallThemed() for colored tool rendering
utils.ts getDisplayItems() includes thinking parts

Test plan

  • Run /chain scout "task" -> planner — should stream by default
  • Run /chain scout "task" -> planner --stream — explicit stream flag
  • Toggle stream mode with v in clarify TUI
  • Set streamModeByDefault: false in config and verify compact view is default
  • Verify status widget clears on chain completion and on errors

…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
@vekexasia
Copy link
Author

You can see in action stream mode here : https://drive.google.com/file/d/1z_eC-vxl_u9N7otjty_CTCVEeqYRThvB/view?usp=drive_link

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