refactor: raw sdk event driven chat#9
Conversation
- Updated TerminalBlockWithOutput to support glob patterns in command rendering. - Improved ResponseMessageBody to handle streaming content more effectively. - Added terminalEventMatchesAssistantTurn function to match terminal events with active assistant turns. - Implemented a performance probe for streaming latency investigation. - Introduced useStreamingDebouncedContent hook to optimize markdown rendering during live streaming. - Enhanced appReducer and messageHandler to manage streaming state and events more efficiently. - Updated MarkdownRenderer to support streaming-aware content debouncing.
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (79)
📝 WalkthroughWalkthroughThe chat system now hydrates history from OpenCode SDK snapshots, adapts SDK messages for rendering, removes centralized raw-event persistence, refines streaming identity and refresh handling, adds SDK event debugging and performance probes, and updates composer attachments, activity rendering, and regression coverage. ChangesSDK-backed chat pipeline
Estimated code review effort: 5 (Critical) | ~120 minutes Possibly related PRs
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Summary
This PR completes the refactoring of the chat system from custom message processing to a raw OpenCode SDK event-driven architecture. The changes establish proper parity between live streaming and session rehydration, improve message delivery reliability, and enhance performance.
Key Changes
Core Architecture Refactoring
SdkMessageAdapterandSessionSnapshotLoaderfor proper SDK hydrationMessage Delivery & Queue Management
@ File References & Context Handling
@filemention resolution with SDK context attachment@references no longer render redundant attachment chipsActivity Timeline & Tool Handling
Robustness & Error Handling
Performance Improvements
Testing Coverage
Migration Impact
Breaking Changes
Compatibility
Testing
Summary by CodeRabbit
New Features
Bug Fixes
Performance