Skip to content

[Bug] TaskStop reports success when the stop RPC fails #46

Description

@alexei-led

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

  1. Start a task with TaskExecute.
  2. Make the subagents:rpc:stop reply return an error or timeout.
  3. Call TaskStop for the task.
  4. 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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions