Skip to content

fix(agents): cancel delegated tasks during owned Action waits #567

Closed

Description

@lastobelus

An app-owned delegated task cannot be cancelled after its source provider turn ends while its owned resumable Action is still running. This was observed during isolated Phase 3 acceptance for #482 on packaged 0.1.7-nightly.20261101.4016 (7179625fccad).

Reproduction:

  1. Delegate a child and let it launch an opted-in controlled waiting Action.
  2. The child ends its turn with an unfinished waiting notice. The logical task correctly remains running with no result, and the Action remains running/armed.
  3. Call task_cancel for that task from its parent.

Actual: task_not_cancellable, with “has no interruptible child run.” The task has an outstanding owned Action obligation even though its provider turn is terminal. One Action command remains running, with no continuation or final notification yet.

Expected: cancel the exact logical task and its owned Action obligation, prevent automatic continuation resurrection, report a truthful cancelled/interrupted outcome and preserve unrelated or later task rounds. Do not fall back to a whole-thread Stop that cancels another round.

Likely admission gap: apps/server/src/mcp/OrchestratorMcpService.ts checks active/queued child runs but does not recognize the owned Action wait as cancellable work.

This is distinct from cancelling only the Action command, which passed: it delivered cancelled_by_user through the same task and then produced one final result without rerunning the command. The failed task-cancellation proof remains unpassed; no waiting prose was treated as success.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions