{"record":{"id":"c92674e63d3387eb","repo":"can1357/oh-my-pi","slug":"cancel-requires-an-operation-id","errorCode":null,"errorMessage":"cancel requires an operation id","messagePattern":"cancel requires an operation id","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"packages/coding-agent/src/slash-commands/helpers/security.ts","lineNumber":388,"sourceCode":"\t\t\t\tconst operation = await coordinator.start({ planId });\n\t\t\t\tawait runtime.output(`Security scan ${operation.scanId} started as ${operation.operationId}.`);\n\t\t\t\treturn commandConsumed();\n\t\t\t}\n\t\t\tcase \"status\": {\n\t\t\t\tconst coordinator = coordinatorFor(runtime);\n\t\t\t\tconst operationId = rest.trim();\n\t\t\t\tif (operationId) {\n\t\t\t\t\tconst operation = await coordinator.status(operationId);\n\t\t\t\t\tif (!operation) throw new Error(`Unknown security operation: ${operationId}`);\n\t\t\t\t\tawait runtime.output(JSON.stringify(operation, null, 2));\n\t\t\t\t} else {\n\t\t\t\t\tawait runtime.output(JSON.stringify(await coordinator.listOperations(), null, 2));\n\t\t\t\t}\n\t\t\t\treturn commandConsumed();\n\t\t\t}\n\t\t\tcase \"cancel\": {\n\t\t\t\tconst operationId = rest.trim();\n\t\t\t\tif (!operationId) throw new Error(\"cancel requires an operation id\");\n\t\t\t\tawait runtime.output(\n\t\t\t\t\t(await coordinatorFor(runtime).cancel(operationId))\n\t\t\t\t\t\t? `Cancellation requested for ${operationId}.`\n\t\t\t\t\t\t: `No cancellable security operation ${operationId}.`,\n\t\t\t\t);\n\t\t\t\treturn commandConsumed();\n\t\t\t}\n\t\t\tcase \"scans\": {\n\t\t\t\tconst scans = await (await SecurityStore.openForCwd(runtime.cwd)).listScans();\n\t\t\t\tawait runtime.output(\n\t\t\t\t\tscans.length === 0\n\t\t\t\t\t\t? \"No security scans are stored for this project.\"\n\t\t\t\t\t\t: scans\n\t\t\t\t\t\t\t\t.map(scan => `${scan.id} ${scan.status} ${scan.findingCount} finding(s) ${scan.producer.name}`)\n\t\t\t\t\t\t\t\t.join(\"\\n\"),\n\t\t\t\t);\n\t\t\t\treturn commandConsumed();\n\t\t\t}","sourceCodeStart":370,"sourceCodeEnd":406,"githubUrl":"https://github.com/can1357/oh-my-pi/blob/969062200754ea02cfac922e5ebb8c608c079e15/packages/coding-agent/src/slash-commands/helpers/security.ts#L370-L406","documentation":"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.","triggerScenarios":"Running `/security cancel` or `/security cancel   ` (empty/whitespace `rest`) inside a coding-agent session.","commonSituations":"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.","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"],"exampleFix":"// before\n/security cancel\n// after\n/security cancel op-1a2b3c","handlingStrategy":"validation","validationCode":"const id = rest.trim();\nif (!id) throw new Error(\"cancel requires an operation id\");\nawait handleSecurityCommand(runtime, `cancel ${id}`);","typeGuard":"null","tryCatchPattern":"null","preventionTips":["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"],"tags":["cli","argument-validation","slash-command"],"backgroundTag":"missing-required-argument","analyzedSha":"969062200754ea02cfac922e5ebb8c608c079e15","analyzedAt":"2026-08-31T10:29:35.737Z","schemaVersion":2},"datasetVersion":"2026-08-31T14:17:45.589Z"}