-
Notifications
You must be signed in to change notification settings - Fork 67
Update BI-copilot review mode logic for persistent context #1185
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
Conversation
…mp project if in review mode and accumulate modified files from previous prompts to improve context management.
…am events. Added functionality to enhance user experience during code reviews.
…nd FinishHandler. Enhance semantic diff loading with refresh capability.
… errors occur or operations are aborted. Update chat state clearing logic to also manage review context and temporary project cleanup.
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the Note Other AI code review bot(s) detectedCodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review. ✨ Finishing touches🧪 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 |
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.
Pull request overview
This PR updates the BI-copilot chat review mode to maintain persistent context from the temporary directory across subsequent prompts, ensuring users can iteratively refine generated code without losing review state. The changes implement a temp project reuse mechanism and improve the review mode lifecycle management.
Key Changes:
- Implements temp project reuse logic when users are in review mode, preventing unnecessary directory recreation between prompts
- Adds automatic review mode opening and refresh notifications after code generation completes
- Enhances cleanup logic to clear review context when chat history is cleared, preventing orphaned temp directories
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
workspaces/ballerina/ballerina-visualizer/src/views/ReviewMode/index.tsx |
Refactored semantic diff loading into a reusable useCallback and added listener for refresh notifications from the extension |
workspaces/ballerina/ballerina-rpc-client/src/BallerinaRpcClient.ts |
Added onRefreshReviewMode method to handle review mode refresh notifications |
workspaces/ballerina/ballerina-extension/src/views/ai-panel/chatStatePersistence.ts |
Enhanced clearChatStateAction to cleanup review context, temp directories, and language server notifications |
workspaces/ballerina/ballerina-extension/src/features/ai/agent/stream-handlers/handlers/finish-handler.ts |
Added accumulated file tracking, automatic review mode opening, and refresh notification sending after code generation |
workspaces/ballerina/ballerina-extension/src/features/ai/agent/stream-handlers/handlers/error-handler.ts |
Added cleanup of pending review context when errors occur to prevent stale state |
workspaces/ballerina/ballerina-extension/src/features/ai/agent/stream-handlers/handlers/abort-handler.ts |
Added cleanup of pending review context when generation is aborted |
workspaces/ballerina/ballerina-extension/src/features/ai/agent/index.ts |
Implemented temp project reuse logic to check for existing review context and skip didOpen notifications for reused projects |
workspaces/ballerina/ballerina-core/src/rpc-types/visualizer/rpc-type.ts |
Defined refreshReviewMode notification type for triggering review mode data reload |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
workspaces/ballerina/ballerina-visualizer/src/views/ReviewMode/index.tsx
Show resolved
Hide resolved
...llerina/ballerina-extension/src/features/ai/agent/stream-handlers/handlers/finish-handler.ts
Show resolved
Hide resolved
workspaces/ballerina/ballerina-visualizer/src/views/ReviewMode/index.tsx
Show resolved
Hide resolved
…existence of the temp project directory before reuse. Clear pending review context if the directory is missing and create a new temp project as needed. Update logic to ensure proper handling of project opening based on temp project reuse status.
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.
Pull request overview
Copilot reviewed 8 out of 8 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Purpose
Updates the BI-copilot chat review mode to ensure subsequent prompts maintain context from the temporary directory.
Changes
tempdirectory if the user is still in review mode, rather than reverting to the base project.Screen.Recording.2025-12-24.at.01.00.11.mov
Related Issues