-
Notifications
You must be signed in to change notification settings - Fork 3.3k
fix(copilot): streaming #1023
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(copilot): streaming #1023
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Greptile Summary
This PR implements comprehensive fixes for the copilot streaming functionality, addressing several key areas including depth configuration, prefetch behavior, UI interactions, and data consistency. The changes introduce a new agent configuration system that separates depth levels (0-3) from a new agentPrefetch boolean flag, replacing the previous system that encoded prefetch behavior using negative depth values (-2, -1). The API route maintains backward compatibility by mapping these negative depths to their positive equivalents with prefetch enabled.
The PR enhances user experience through several UI improvements: the ThinkingBlock component now auto-expands during streaming and collapses when finished, the copilot chat implements sophisticated scroll state tracking to prevent auto-scroll from interfering with user reading, and the user input component features a redesigned slider-based interface with clearer labeling (Fast/Balanced/Advanced/Expert). A checkpoint system has been added to diff controls, creating restore points before accepting copilot changes.
Critical data consistency fixes ensure the copilot has access to the most recent workflow state by merging subblock values from the store into both the workflow retrieval tool and diff engine baseline. This prevents user edits from being lost during copilot operations. The streaming system now includes comprehensive tool call progress tracking to only persist conversation IDs at safe checkpoints where no tools are mid-execution.
Confidence score: 2/5
- This PR requires careful review due to complex state management changes and a critical duplicate file issue
- Score lowered significantly due to an empty duplicate store file that could cause import conflicts and build issues
- Pay close attention to
apps/sim/apps/sim/stores/copilot/store.tswhich is an empty duplicate that needs removal
15 files reviewed, 3 comments
...components/panel/components/copilot/components/copilot-message/components/thinking-block.tsx
Show resolved
Hide resolved
.../w/[workflowId]/components/panel/components/copilot/components/user-input/copilot-slider.tsx
Show resolved
Hide resolved
...m/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/copilot/copilot.tsx
Show resolved
Hide resolved
* Fix 1 * Fix * Bugfix * Make thinking streaming smoother * Better autoscroll, still not great * Updates * Updates * Updates * Restore checkpoitn logic * Fix aborts * Checkpoitn ui * Lint * Fix empty file
Summary
Fixes copilot streaming, checkpoints, depths, etc
Type of Change
Testing
Manual
Checklist