Skip to content

scans: add a 'cancel' command - #1

Open
ananay wants to merge 2 commits into
mainfrom
feat/cli-scan-cancel
Open

ananay wants to merge 2 commits into
mainfrom
feat/cli-scan-cancel

Conversation

@ananay

@ananay ananay commented Jul 28, 2026 •

Copy link
Copy Markdown
Contributor

No description provided.

ananay added 2 commits July 28, 2026 09:48
There was no way to stop a scan from the CLI. Pairs with the new
POST /api/projects/{id}/scans/{scan_id}/cancel route (openhackai/app#53),
which cancels the Temporal workflow and marks the scan cancelled.

    openhack-cli scans cancel <scan_id> [--project ID] [--yes]

Confirms before cancelling on an interactive run, and skips the prompt
under --json so scripted use can't hang on a hidden prompt.

Reports which thing actually happened. The route returns
workflow_cancelled: false when the workflow was already gone (the worker
died, or the scan finished between the read and the call) — the scan is
still marked cancelled, so saying "cancelled" flatly would imply we
stopped something that was no longer running.

Also recolours the "cancelled" status from red to dim. A deliberate
cancel is not a failure, and the dashboard renders it muted; matching red
to "failed" made an intentional action look like an error.

https://claude.ai/code/session_011bV5NF1FAx8trn8MxHjAVM
@greptile-apps

greptile-apps Bot commented Oct 21, 2026 •

Copy link
Copy Markdown

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge, with the documented requirement that the server cancellation route be deployed before use.

Summary

Adds openhack-cli scans cancel <scan_id> with an optional project and confirmation bypass.

  • CLI users can cancel a pending or running scan.
  • Cancelled scans appear dim instead of red.

Reviews (1) · Last reviewed commit: "docs: document scan cancellation" · Reviewed by Greptile

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant