Skip to content

feat: Implement ACP inline streaming with word wrapping#48

Merged
CSRessel merged 3 commits intomainfrom
feature/setup-acp-inline-streaming
Nov 15, 2025
Merged

feat: Implement ACP inline streaming with word wrapping#48
CSRessel merged 3 commits intomainfrom
feature/setup-acp-inline-streaming

Conversation

@CSRessel
Copy link
Copy Markdown
Collaborator

Summary

This PR introduces a new inline streaming system for ACP agents that displays assistant messages incrementally with proper word wrapping before committing them to the scrollback buffer.

Key Changes

  • New BackendEvent enum: Wraps ConversationEvent and adds inline events (InlineBegin, InlineUpdate, InlineCommit, InlineAbort)
  • InlineEntryState tracking: Manages streaming text with dynamic word wrapping in src/history.rs
  • Text wrapping utility: New text_utils module with wrap_text_to_width function for proper text reflow
  • Backend updates: All backends now emit BackendEvent instead of ConversationEvent
  • UI integration: Model tracks inline entries and renders them separately from committed scrollback
  • Test updates: All tests updated to handle new BackendEvent structure with inline event tracking

Benefits

✨ Assistant messages appear immediately as they stream
📐 Proper word wrapping adapts to terminal width changes
🎯 Cleaner separation between streaming and committed content
🧪 All tests passing with comprehensive inline event handling

Test Plan

  • All existing tests pass
  • New inline event tracking tested in acp_runner_test.rs
  • Word wrapping behavior verified
  • Terminal resize handling tested

🤖 Generated with Claude Code

CSRessel and others added 3 commits November 14, 2025 21:25
This commit introduces a new inline streaming system for ACP agents that
displays assistant messages incrementally with proper word wrapping before
committing them to the scrollback buffer.

Key changes:
- Add BackendEvent enum to wrap ConversationEvent and inline events
- Implement InlineEntryState for tracking streaming text with wrapping
- Add text_utils module with wrap_text_to_width function
- Update all backends to emit BackendEvent instead of ConversationEvent
- Track inline entries in Model and render them in UI
- Update tests to handle new BackendEvent structure

Benefits:
- Assistant messages now appear immediately as they stream
- Proper word wrapping adapts to terminal width changes
- Cleaner separation between streaming and committed content

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
- handle AgentThoughtChunk updates and emit thinking entries
- track separate assistant/thinking buffers with commit/abort-all helpers
- adjust history types and inline tracker test coverage
@CSRessel
Copy link
Copy Markdown
Collaborator Author

First time I used an agent via the nori CLI for something useful! (after doing the work elsewhere, asked it to create this commit and github PR)

Screenshot from 2025-11-14 22-28-02

@CSRessel CSRessel merged commit cc9dcd0 into main Nov 15, 2025
3 checks passed
@CSRessel CSRessel deleted the feature/setup-acp-inline-streaming branch November 15, 2025 04:23
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