Skip to content

Conversation

@RNViththagan
Copy link
Contributor

Add checkpoint and restore system that allows users to revert the AI copilot conversation and workspace to previous states.

Changes

  • Automatic checkpoint capture on user messages
  • Workspace snapshot (file contents + structure)
  • Real-time notification when checkpoint is ready
  • Revert button on user messages
  • Synchronous state updates to prevent race conditions
  • LocalStorage sync with state machine

Resolves wso2/product-ballerina-integrator#1982
Related to wso2/product-ballerina-integrator#780

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Nov 21, 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.

✨ 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.

@RNViththagan RNViththagan force-pushed the copilot-agent-checkpoint-mechanism branch 4 times, most recently from 9b0bf0d to a65f7ec Compare November 24, 2025 05:12
@RNViththagan RNViththagan marked this pull request as ready for review November 24, 2025 05:13
- Capture workspace snapshots on user messages
- Add revert button to restore conversation and files to previous state
- Implement real-time notification when checkpoint is ready
- Sync localStorage with state machine on restore
- Add experimental badge to AI chat interface
- Fix plan approval trigger by moving FINISH_EXECUTION handler
- Add missing LibraryProviderTool event handler
@RNViththagan RNViththagan force-pushed the copilot-agent-checkpoint-mechanism branch from a65f7ec to a5c250c Compare November 24, 2025 07:01
@RNViththagan RNViththagan force-pushed the copilot-agent-checkpoint-mechanism branch from a5c250c to 0be430a Compare November 24, 2025 11:56
Copy link
Contributor

@xlight05 xlight05 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added some comments, lets address it in a seperate PR

setMessages(uiMessages);

chatArray = chatArray.slice(0, updatedMessages.length);
localStorage.setItem(`chatArray-AIGenerationChat-${projectUuid}`, JSON.stringify(chatArray));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we need this anymore? I think we should remove this altogether

}
}

async function getAllWorkspaceFiles(workspaceRoot: vscode.Uri, ignorePatterns: string[]): Promise<vscode.Uri[]> {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This implementatin may have to change based on ballerina worksapces concept

@xlight05 xlight05 merged commit 8bf412b into wso2:feature-ai-design-mode Nov 25, 2025
4 of 5 checks passed
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