Skip to content

Conversation

roomote[bot]
Copy link

@roomote roomote bot commented Sep 28, 2025

Description

This PR implements custom checkpoint functionality as requested in #8350. Users can now manually create checkpoints at any point during their workflow, providing better control over when to save the state of their work.

Changes

  • ✅ Added command to VSCode command system
  • ✅ Updated checkpoint system to accept custom messages for better identification
  • ✅ Added UI button in TaskActions component for creating custom checkpoints (only visible when checkpoints are enabled)
  • ✅ Added webview message handler for custom checkpoint requests
  • ✅ Added translation strings for custom checkpoint UI
  • ✅ Updated Task and checkpoint services to support custom messages

Implementation Details

The implementation leverages the existing checkpoint infrastructure while adding:

  1. A new command that can be triggered from the command palette or UI
  2. A save button in the task actions area (next to export, copy, etc.)
  3. A prompt for users to enter a custom description for their checkpoint
  4. Proper integration with the existing Git-based checkpoint system

Testing

  • All existing tests pass ✅
  • Manual testing completed for:
    • Creating custom checkpoints via UI button
    • Creating custom checkpoints via command palette
    • Verifying checkpoints are created with custom messages
    • Ensuring feature is only available when checkpoints are enabled

Screenshots

The new checkpoint button appears in the task actions area when checkpoints are enabled.

Fixes #8350


Important

Adds custom checkpoint functionality with UI integration and command support, allowing users to create checkpoints with custom messages.

  • Behavior:
    • Adds custom checkpoint functionality allowing users to create checkpoints with custom messages.
    • Integrates with existing Git-based checkpoint system.
    • Custom checkpoints can be created via UI button or command palette.
  • Commands:
    • Adds saveCustomCheckpoint command to vscode.ts and registerCommands.ts.
    • Handles custom checkpoint creation in webviewMessageHandler.ts.
  • UI:
    • Adds a button in TaskActions.tsx for creating custom checkpoints.
    • Updates translation strings in common.json and chat.json for custom checkpoint prompts and messages.
  • Backend:
    • Updates checkpointSave in index.ts to support custom messages.
    • Modifies Task.ts to handle custom checkpoint logic.

This description was created by Ellipsis for 9b2f4ab. You can customize this summary. It will automatically update as commits are pushed.

- Add saveCustomCheckpoint command to VSCode command system
- Update checkpoint system to accept custom messages
- Add UI button in TaskActions for creating custom checkpoints
- Add webview message handler for custom checkpoint requests
- Add translation strings for custom checkpoint UI
- Update Task and checkpoint services to support custom messages

Fixes #8350
@roomote roomote bot requested review from mrubens, cte and jr as code owners September 28, 2025 11:23
@dosubot dosubot bot added size:L This PR changes 100-499 lines, ignoring generated files. enhancement New feature or request labels Sep 28, 2025
@hannesrudolph hannesrudolph added the Issue/PR - Triage New issue. Needs quick review to confirm validity and assign labels. label Sep 28, 2025
Copy link
Author

@roomote roomote bot left a comment

Choose a reason for hiding this comment

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

Self-review: auditing my own impulses; if I disagree with me, one of us is wrong.

case "saveCustomCheckpoint": {
const currentTask = provider.getCurrentTask()
if (!currentTask) {
vscode.window.showErrorMessage(t("common:checkpoint.no_active_task"))
Copy link
Author

Choose a reason for hiding this comment

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

[P1] i18n key mismatch: uses t("common:checkpoint.no_active_task") but en/common.json defines this key at the common root (not under checkpoint). Align to t("common:no_active_task") (same for checkpoints_disabled) or move keys under common.checkpoint consistently.

break
}

if (!getGlobalState("enableCheckpoints")) {
Copy link
Author

Choose a reason for hiding this comment

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

[P2] Mixed enablement checks: here we check getGlobalState("enableCheckpoints") while the command path checks currentTask.enableCheckpoints. Pick a single source of truth (prefer task-scoped) to avoid divergence.

try {
// Force checkpoint creation with custom message
// Parameters: force=true (create even without changes), suppressMessage=false (show in UI), customMessage
await currentTask.checkpointSave(true, false, customMessage)
Copy link
Author

Choose a reason for hiding this comment

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

[P2] UX consistency: the command path also emits a chat event via currentTask.say("checkpoint_saved_custom", …). Consider emitting the same here so the checkpoint appears in chat history, not just a toast.

// Get the current task
const currentTask = visibleProvider.getCurrentTask()
if (!currentTask) {
vscode.window.showInformationMessage(t("common:errors.no_active_task"))
Copy link
Author

Choose a reason for hiding this comment

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

[P1] i18n key mismatch: t("common:errors.no_active_task"). The en/common.json addition places 'no_active_task' at the common root, not under errors. Either switch to t("common:no_active_task") (and t("common:checkpoints_disabled")) or move these keys under common.errors in the locale file.


if (message !== undefined) {
// Force save checkpoint even if no file changes with custom message
await currentTask.checkpointSave(true, false, message)
Copy link
Author

Choose a reason for hiding this comment

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

[P3] Avoid blank custom checkpoint messages by defaulting on empty input.

Suggested change
await currentTask.checkpointSave(true, false, message)
const trimmed = (message ?? '').trim()
const finalMessage = trimmed || t('common:checkpoint.custom_default')
await currentTask.checkpointSave(true, false, finalMessage)

const { enableCheckpoints } = useExtensionState()

const handleCustomCheckpoint = () => {
const message = prompt(t("chat:checkpoint.custom_prompt"), t("chat:checkpoint.custom_default"))
Copy link
Author

Choose a reason for hiding this comment

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

[P3] Using window.prompt() blocks the UI and is inconsistent with the rest of the UI patterns. Consider using a non-blocking Dialog component with proper i18n and focus handling.

"focusPanel",
"toggleAutoApprove",
"saveCustomCheckpoint",
] as const
Copy link
Author

Choose a reason for hiding this comment

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

[P2] New command id 'saveCustomCheckpoint' added. Ensure it is contributed in the extension package.json (contributes.commands) so users can invoke it from the Command Palette.

"subtask_result",
"checkpoint_saved",
"checkpoint_saved_custom",
"rooignore_error",
Copy link
Author

Choose a reason for hiding this comment

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

[P3] New say type 'checkpoint_saved_custom' added. Verify all renderers that map say types handle this with an appropriate label/icon to avoid generic presentation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request Issue/PR - Triage New issue. Needs quick review to confirm validity and assign labels. size:L This PR changes 100-499 lines, ignoring generated files.
Projects
Status: Triage
Development

Successfully merging this pull request may close these issues.

[ENHANCEMENT] Enable me to add custom checkpoint.
2 participants