feat(agent): add task cancellation with stop button
Users can now interrupt running agents via a "Stop" button on the live
card. The daemon polls task status every 5 seconds and kills the agent
process when cancellation is detected.
Changes:
- New CancelAgentTask SQL query and CancelTask service method
- POST /api/issues/{id}/tasks/{taskId}/cancel endpoint
- Daemon polls GetTaskStatus during execution, cancels context on match
- Frontend: Stop button on AgentLiveCard, task:cancelled WS event
This commit is contained in:
parent
3b6f64ba8e
commit
365b5b5f0e
10 changed files with 173 additions and 4 deletions
|
|
@ -352,6 +352,12 @@ export class ApiClient {
|
|||
return this.fetch(`/api/issues/${issueId}/task-runs`);
|
||||
}
|
||||
|
||||
async cancelTask(issueId: string, taskId: string): Promise<AgentTask> {
|
||||
return this.fetch(`/api/issues/${issueId}/tasks/${taskId}/cancel`, {
|
||||
method: "POST",
|
||||
});
|
||||
}
|
||||
|
||||
async getDaemonPairingSession(token: string): Promise<DaemonPairingSession> {
|
||||
return this.fetch(`/api/daemon/pairing-sessions/${token}`);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue