Skip to content

Runtime never sends job.cancelled ack, and cancelling an unknown job is silently dropped (§7.4, §12) #75

@nficano

Description

@nficano

Category: spec-conformance Severity: minor
Location: src/Arcp.Runtime/SessionState.Dispatch.cs:85-91, src/Arcp.Runtime/JobManager.cs:444-455, src/Arcp.Core/Messages/MessageTypeNames.cs
Spec: ARCP v1.1 §7.4, §12

What

Spec §7.4: "The runtime acknowledges with job.cancelled and emits job.error with code CANCELLED." The SDK has no job.cancelled message type at all and never sends the acknowledgement — it only emits the terminal job.error{CANCELLED} from the run-loop. Separately, when job.cancel references a job that does not exist (or belongs to another principal), JobManager.Cancel returns false and the dispatcher discards the result, so no JOB_NOT_FOUND (§12) is surfaced; the client gets silence.

Evidence

case MessageTypeNames.JobCancel:
    if (env.Payload is JobCancelPayload cancel)
    {
        if (JobId.TryParse(cancel.JobId, null, out var jid))
            _server.JobManager.Cancel(jid, Principal?.Subject, cancel.Reason);  // bool result ignored
    }
    break;

grep for job.cancelled/JobCancelled across src/ returns nothing.

Proposed fix

  1. Add MessageTypeNames.JobCancelled = "job.cancelled" and a payload; on a successful Cancel, send job.cancelled to the submitting session before the run-loop emits job.error{CANCELLED}.
  2. When Cancel returns false, send session.error{JOB_NOT_FOUND}.

Acceptance criteria

  • A successful job.cancel produces a job.cancelled ack followed by job.error{CANCELLED, final_status:"cancelled"}.
  • job.cancel for a non-existent/foreign job yields JOB_NOT_FOUND.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions