Skip to main content
← Back to list
01Issue
BugShippedSwamp CLIPublic
Assigneeshammz

Relationships

#2650 workflow cancel --server shows raw JSON errors and drops --reason

Opened by hammz · 9/28/2026· Shipped 9/29/2026

Problem

With swamp-club#2514, swamp workflow cancel --run --server can clear a suspended run that serve started. The CLI side of that path has three rough edges (src/cli/commands/workflow_cancel.ts, --server branch, and cancelExecution in src/cli/commands/serve.ts):

  1. Any non-2xx response is thrown as 'Server returned : '. A 409 conflict therefore prints raw JSON, for example: Server returned 409: {"status":"conflict","message":"Another operation on this run is in progress; try again"}. The message field was written for people and should be shown on its own.
  2. A miss still says 'No active workflow-run with id in this serve instance'. The endpoint now also searches persisted suspended runs, and any serve instance can cancel one, so the wording understates what was checked. The WebSocket reply says 'No cancellable run with id '.
  3. --reason is ignored with --server, with a warning, because the HTTP endpoint takes no reason. The run records 'cancelled by ' as its cancel_reason, but the CLI's --json output reports reason 'Cancelled by user', which does not match the record. The WebSocket workflow.cancel request does accept a reason.

Suggested fix

  • Show body.message for non-2xx responses when present.
  • Reword the not-found message.
  • Accept an optional reason on POST /api/v1/cancel/workflow-run/ and send --reason, so the run records it and the CLI reports what was recorded.

Acceptance

  • A 409 or 404 from --server cancel prints the server's message without JSON.
  • swamp workflow cancel --run --server --reason 'x' records 'x (cancelled by )', and --json reports the recorded reason.
02Bog Flow
✓OPEN✓TRIAGED✓IN PROGRESS✓SHIPPED+ 1 MOREASSIGNED+ 5 MOREREVIEW+ 11 MOREPR_MERGED+ 2 MORESESSION_SUMMARIZED

Shipped

9/29/2026, 5:43:02 PM

Click a lifecycle step above to view its details.

03Sludge Pulse
hammz assigned hammz9/29/2026, 5:04:37 PM

Sign in to post a ripple.