Repository navigation
Core ‐ Agent remove‐task
Bohdan Karpenko edited this page Apr 1, 2026
·
1 revision
This handler is responsible for removing an existing task from the system. It validates input data, executes a database deletion, and returns the appropriate response.
Deletes a task by its unique identifier. The request requires the id field in the data object.
{
"type": "request",
"action": "remove-task",
"id": 1,
"data": {
"id": 123
}
}-
type: must be"request" -
action: must be"remove-task" -
id: request identifier (mirrored in the response) -
data.id: integer, required — the ID of the task to delete
- Validates that
datais present and contains a validid. - Executes a SQL
DELETEquery on thetaskstable. - If deletion is successful (
rows_affected == 1), returns a success response. - If deletion fails (missing data, invalid ID, or task not found), returns an error response.
{
"type": "response",
"id": 1,
"status": "ok",
"code": 200,
"message": "Successfully deleted task 123"
}{
"type": "response",
"id": 1,
"status": "error",
"code": 400,
"message": "Missing data"
}{
"type": "response",
"id": 1,
"status": "error",
"code": 400,
"message": "Failed to delete task, bad request"
}-
"ok"— task deleted successfully -
"error"— deletion failed or request invalid
- Only a single task can be deleted per request.
-
idmust correspond to an existing task; otherwise, the operation fails. - The database deletion is atomic: either the task is removed, or no changes occur.