Skip to content

Conversation

@kanushka
Copy link
Contributor

@kanushka kanushka commented Dec 23, 2025

Purpose

Updates the BI-copilot chat review mode to ensure subsequent prompts maintain context from the temporary directory.

Changes

  • Persist Context: Updated the next prompt flow so BI-copilot pulls from the temp directory if the user is still in review mode, rather than reverting to the base project.
  • Review Mode Visibility: Ensured review mode is displayed by default following code generation.
  • Cleanup Logic: Fixed an issue to ensure review mode is cleared when the user clears the chat history.
Screen.Recording.2025-12-24.at.01.00.11.mov

Related Issues

…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.
@kanushka kanushka requested review from Copilot and removed request for gigara and hevayo December 23, 2025 19:28
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Dec 23, 2025

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Note

Other AI code review bot(s) detected

CodeRabbit 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)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Contributor

Copilot AI left a 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.

…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.
Copy link
Contributor

Copilot AI left a 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.

@kanushka kanushka requested a review from axewilledge December 24, 2025 03:35
@kanushka kanushka merged commit acbb557 into wso2:bi-1.6.x Dec 24, 2025
12 checks passed
@kanushka kanushka deleted the ai-review-mode-fix branch December 24, 2025 03:42
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.

2 participants