feat: add streaming output renderer#81
Open
zgc37359-lang wants to merge 1 commit intoMiniMax-AI:mainfrom
Open
Conversation
Add StreamingRenderer class that implements stable prefix + unstable suffix pattern for incremental command output rendering. This reduces visual flicker during long-running tasks like npm test or pytest. - StreamingRenderer class with update/render/clear methods - Helper functions for terminal control (erase_lines, move_cursor_up) - 18 test cases covering all functionality Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Author
|
This PR addresses issue #71 - streaming output support for LLM responses. The |
2 tasks
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
Add
StreamingRendererclass that implements the stable prefix + unstable suffix pattern for incremental command output rendering. This reduces visual flicker during long-running tasks likenpm testorpytest.Changes
mini_agent/streaming.py: New module with
StreamingRendererclassupdate(): Processes incremental content, returns stable prefixrender(): Returns complete rendered stringclear(): Resets renderer stateerase_lines(),move_cursor_up(),clear_line()tests/test_streaming.py: 18 test cases covering all functionality
Design
Lines ending with
\nare considered "stable" and will not be re-rendered. The last line (without a trailing newline) is considered "unstable" and will be updated on each render. This pattern is borrowed from Claude Code's approach to handling streaming output.Test plan
🤖 Generated with Claude Code