Summary
TaskStop reports success and marks a subagent task as completed when the stop RPC fails.
Evidence
stopSubagent() catches every RPC error and returns a resolved promise:
TaskStop then updates the task to completed and returns a success message:
Reproduction
- Start a task with
TaskExecute.
- Make the
subagents:rpc:stop reply return an error or timeout.
- Call
TaskStop for the task.
- Read the task with
TaskGet or TaskList.
Expected behavior
The tool returns an error when the stop RPC fails. The task stays in_progress, or uses a clear stopping state.
Actual behavior
The tool returns Task ... stopped successfully. The task has status completed, although the subagent can still run.
Impact
The task list reports a false result. A dependent task can start while the stopped subagent still runs.
Requested change
- Do not catch and ignore stop RPC errors.
- Do not mark the task as
completed after a failed stop request.
- Keep the existing stopped-event handler as the source for final completion.
- Add a regression test for an RPC error and a timeout.
Summary
TaskStopreports success and marks a subagent task ascompletedwhen the stop RPC fails.Evidence
stopSubagent()catches every RPC error and returns a resolved promise:src/index.ts:197-200TaskStopthen updates the task tocompletedand returns a success message:src/index.ts:965-972Reproduction
TaskExecute.subagents:rpc:stopreply return an error or timeout.TaskStopfor the task.TaskGetorTaskList.Expected behavior
The tool returns an error when the stop RPC fails. The task stays
in_progress, or uses a clear stopping state.Actual behavior
The tool returns
Task ... stopped successfully. The task has statuscompleted, although the subagent can still run.Impact
The task list reports a false result. A dependent task can start while the stopped subagent still runs.
Requested change
completedafter a failed stop request.