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

  1. Supply an operation id: `/security cancel <id>`
  2. List active operations first with the list subcommand, then copy an id from its JSON output
  3. 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

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


AI-assisted analysis of can1357/oh-my-pi@9690622007 (2026-08-31). Data as JSON: /api/errors/c92674e63d3387eb. Report an issue: GitHub.