Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

feat: add streaming output renderer#81

Open
zgc37359-lang wants to merge 1 commit into
MiniMax-AI:main from
zgc37359-lang:feat/streaming-renderer
Open

feat: add streaming output renderer #81
zgc37359-lang wants to merge 1 commit into
MiniMax-AI:main from
zgc37359-lang:feat/streaming-renderer

Conversation

@zgc37359-lang

@zgc37359-lang zgc37359-lang commented Apr 2, 2026

Copy link
Copy Markdown

Summary

Add StreamingRenderer class that implements the stable prefix + unstable suffix pattern for incremental command output rendering. This reduces visual flicker during long-running tasks like npm test or pytest.

Changes

  • mini_agent/streaming.py: New module with StreamingRenderer class

    • update(): Processes incremental content, returns stable prefix
    • render(): Returns complete rendered string
    • clear(): Resets renderer state
    • Helper functions: erase_lines(), move_cursor_up(), clear_line()
  • tests/test_streaming.py: 18 test cases covering all functionality

Design

Lines ending with \n are 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

  • All 18 tests pass
  • Manual testing with long-running commands

🤖 Generated with Claude Code

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>

Copy link
Copy Markdown
Author

This PR addresses issue #71 - streaming output support for LLM responses. The StreamingRenderer class provides incremental rendering that reduces visual flicker during long-running tasks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

1 participant

AltStyle によって変換されたページ (->オリジナル) /