can1357/oh-my-pi · warning
cancel requires an operation id
Error message
cancel requires an operation id
What it means
The /security slash command's `cancel` subcommand requires an operation id argument. handleSecurityCommand throws this when the user runs `/security cancel` with no (or only whitespace) arguments, since coordinator.cancel() cannot identify which operation to cancel without an id.
Source
Thrown at packages/coding-agent/src/slash-commands/helpers/security.ts:388
const operation = await coordinator.start({ planId });
await runtime.output(`Security scan ${operation.scanId} started as ${operation.operationId}.`);
return commandConsumed();
}
case "status": {
const coordinator = coordinatorFor(runtime);
const operationId = rest.trim();
if (operationId) {
const operation = await coordinator.status(operationId);
if (!operation) throw new Error(`Unknown security operation: ${operationId}`);
await runtime.output(JSON.stringify(operation, null, 2));
} else {
await runtime.output(JSON.stringify(await coordinator.listOperations(), null, 2));
}
return commandConsumed();
}
case "cancel": {
const operationId = rest.trim();
if (!operationId) throw new Error("cancel requires an operation id");
await runtime.output(
(await coordinatorFor(runtime).cancel(operationId))
? `Cancellation requested for ${operationId}.`
: `No cancellable security operation ${operationId}.`,
);
return commandConsumed();
}
case "scans": {
const scans = await (await SecurityStore.openForCwd(runtime.cwd)).listScans();
await runtime.output(
scans.length === 0
? "No security scans are stored for this project."
: scans
.map(scan => `${scan.id} ${scan.status} ${scan.findingCount} finding(s) ${scan.producer.name}`)
.join("\n"),
);
return commandConsumed();
}View on GitHub (pinned to 9690622007)
Solutions
- Supply an operation id: `/security cancel <id>`
- List active operations first with the list subcommand, then copy an id from its JSON output
- Interactively type the command followed by a space and the id, then submit
Example fix
// before /security cancel // after /security cancel op-1a2b3c
Defensive patterns
Strategy: validation
Validate before calling
const id = rest.trim();
if (!id) throw new Error("cancel requires an operation id");
await handleSecurityCommand(runtime, `cancel ${id}`); Type guard
null
Try / catch
null
Prevention
- Always pass an explicit operation id with /security cancel
- Run the list subcommand first to obtain valid ids
- Validate non-empty args in wrappers around the security command
When it happens
Trigger: Running `/security cancel` or `/security cancel ` (empty/whitespace `rest`) inside a coding-agent session.
Common situations: User forgets the operation id, copies an incomplete command, or expects the CLI to cancel the 'current' operation implicitly — the command has no implicit default.
Understand the failure class
Background: "missing required argument" and "the following required arguments were not provided": what required-argument errors mean and how to fix them — this error's family across 20 libraries.
Related errors
- validate requires a finding URI or <scan-id> <finding-id>
- show requires a scan id or security:// URI
- import requires a SARIF file or Codex Security bundle direct
- export requires <scan-id> --output <path> [--format bundle|s
- Unknown export format: ${value}
AI-assisted analysis of can1357/oh-my-pi@9690622007 (2026-08-31).
Data as JSON: /api/errors/c92674e63d3387eb.
Report an issue: GitHub.