feat: implement execution control (pause/resume/abort) for agent mode

Adds execution control system per GitHub issue #113:
- Ctrl+P: Toggle pause/resume during agent execution
- Ctrl+Z: Abort with rollback (undo file changes)
- Ctrl+Shift+S: Toggle step-by-step mode
- Enter: Advance one step when in step mode

New files:
- src/types/execution-control.ts: Type definitions
- src/services/execution-control.ts: Control implementation with rollback
- src/constants/execution-control.ts: Keyboard shortcuts and messages

Modified:
- agent-stream.ts: Integrated execution control into agent loop
- message-handler.ts: Added control functions and callbacks
- app.tsx: Added keyboard shortcut handlers
- help-content.ts: Added help topics for new shortcuts

Closes #113
This commit is contained in:
2026-02-05 18:47:08 -05:00
parent e2cb41f8d3
commit 3d2195f074
8 changed files with 853 additions and 31 deletions

View File

@@ -173,6 +173,33 @@ export const HELP_TOPICS: HelpTopic[] = [
shortcuts: ["Ctrl+M"],
category: "shortcuts",
},
{
id: "shortcut-ctrlp",
name: "Ctrl+P",
shortDescription: "Pause/Resume",
fullDescription:
"Toggle pause/resume during agent execution. When paused, tool calls are suspended until resumed.",
shortcuts: ["Ctrl+P"],
category: "shortcuts",
},
{
id: "shortcut-ctrlz",
name: "Ctrl+Z",
shortDescription: "Abort with rollback",
fullDescription:
"Abort current operation and rollback file changes made during this execution. Use to undo unwanted modifications.",
shortcuts: ["Ctrl+Z"],
category: "shortcuts",
},
{
id: "shortcut-ctrlshifts",
name: "Ctrl+Shift+S",
shortDescription: "Toggle step mode",
fullDescription:
"Enable step-by-step mode where you can advance one tool call at a time. Press Enter to execute each tool.",
shortcuts: ["Ctrl+Shift+S"],
category: "shortcuts",
},
];
export const getTopicsByCategory = (category: HelpCategory): HelpTopic[] =>