-
Notifications
You must be signed in to change notification settings - Fork 2.3k
feat: add custom checkpoint functionality #8351
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
base: main
Are you sure you want to change the base?
Conversation
- 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
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.
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")) |
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.
[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")) { |
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.
[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) |
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.
[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")) |
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.
[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) |
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.
[P3] Avoid blank custom checkpoint messages by defaulting on empty input.
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")) |
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.
[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 |
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.
[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", |
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.
[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.
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
Implementation Details
The implementation leverages the existing checkpoint infrastructure while adding:
Testing
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.
saveCustomCheckpoint
command tovscode.ts
andregisterCommands.ts
.webviewMessageHandler.ts
.TaskActions.tsx
for creating custom checkpoints.common.json
andchat.json
for custom checkpoint prompts and messages.checkpointSave
inindex.ts
to support custom messages.Task.ts
to handle custom checkpoint logic.This description was created by
for 9b2f4ab. You can customize this summary. It will automatically update as commits are pushed.