Two scenarios that exercise the §10.4–§10.5 control surface that distinguishes ARCP from "agent over plain HTTP":
cancel: cooperative termination with a deadline.interrupt: pause the job and route through a human, no termination.
Cancellation usually means closing the socket or trying to kill the process. The agent's tool was already mid-network call, so it either completes anyway (silent waste of money) or leaves a half-applied side effect. There's no notion of "stop and ask"; the only knob is "stop".
// Stop the job; the runtime drives it to a clean checkpoint
// inside `deadline_ms` before terminating.
$client->cancelJob($jobId, 'user_aborted', 5_000); // cancel.accepted
$terminal = awaitTerminal($client, $jobId); // job.cancelled
// Or: pause the job, ask the human, resume.
interruptJob($client, $jobId, 'Pause and ask before touching prod.');
// runtime emits human.input.request; answer with the HITL relay.cancelcooperative contract — RFC §10.4 (cancel.accepted/cancel.refused,deadline_ms, escalation toABORTED).interrupt(distinct from cancel) — §10.5; emitshuman.input.request, leaves the job inblocked.capabilities.interrupt: falsefallback tocancel(advertised per §10.5; clients that findinterrupt: falseon a peer fall through tocancel).
main.php— two scenarios driven by$argv[1](cancelorinterrupt).
- Pair
interruptwith human_input for a working pause-and-ask loop. - Send
cancelagainst astream_idinstead of ajob_idto terminate just one stream — terminal is astream.errorwithcode: CANCELLED(§10.4). - Race many peers, cancel the slowest once N succeed.