Skip to content

Commit b27457a

Browse files
committed
github copilot preset fallback for vsc ext
1 parent d75088f commit b27457a

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/commands/checkpoint_agent/agent_presets.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -532,12 +532,11 @@ impl AgentCheckpointPreset for GithubCopilotPreset {
532532
.map_err(|e| GitAiError::PresetError(format!("Invalid JSON in hook_input: {}", e)))?;
533533

534534
// Extract hook_event_name to determine checkpoint type
535+
// Fallback to "after_edit" if not set (for older versions of the VS Code extension)
535536
let hook_event_name = hook_data
536537
.get("hook_event_name")
537538
.and_then(|v| v.as_str())
538-
.ok_or_else(|| {
539-
GitAiError::PresetError("hook_event_name not found in hook_input".to_string())
540-
})?;
539+
.unwrap_or("after_edit");
541540

542541
// Validate hook_event_name
543542
if hook_event_name != "before_edit" && hook_event_name != "after_edit" {

0 commit comments

Comments
 (0)