{"record":{"id":"98befb4c9f64af21","repo":"can1357/oh-my-pi","slug":"compare-requires-before-scan-id-after-scan-id","errorCode":null,"errorMessage":"compare requires <before-scan-id> <after-scan-id>","messagePattern":"compare requires <before-scan-id> <after-scan-id>","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"packages/coding-agent/src/slash-commands/helpers/security.ts","lineNumber":430,"sourceCode":"\t\t\t\treturn commandConsumed();\n\t\t\tcase \"export\":\n\t\t\t\tawait exportResults(runtime, rest);\n\t\t\t\treturn commandConsumed();\n\t\t\tcase \"validate\": {\n\t\t\t\tconst target = findingTarget(rest);\n\t\t\t\treturn {\n\t\t\t\t\tprompt: prompt\n\t\t\t\t\t\t.render(validationRequestPrompt, {\n\t\t\t\t\t\t\tfindingUri: target.uri,\n\t\t\t\t\t\t\tscanId: target.scanId,\n\t\t\t\t\t\t\tfindingId: target.findingId,\n\t\t\t\t\t\t})\n\t\t\t\t\t\t.trim(),\n\t\t\t\t};\n\t\t\t}\n\t\t\tcase \"compare\": {\n\t\t\t\tconst [beforeScanId, afterScanId] = parseCommandArgs(rest);\n\t\t\t\tif (!beforeScanId || !afterScanId) throw new Error(\"compare requires <before-scan-id> <after-scan-id>\");\n\t\t\t\tconst report = await (await SecurityStore.openForCwd(runtime.cwd)).compare(beforeScanId, afterScanId);\n\t\t\t\tawait runtime.output(JSON.stringify(report, null, 2));\n\t\t\t\treturn commandConsumed();\n\t\t\t}\n\t\t\tcase \"cloud\":\n\t\t\t\tawait handleCloudCommand(runtime, rest);\n\t\t\t\treturn commandConsumed();\n\t\t\tcase \"disposition\":\n\t\t\t\tawait updateDisposition(runtime, rest);\n\t\t\t\treturn commandConsumed();\n\t\t\tdefault:\n\t\t\t\treturn usage(\n\t\t\t\t\t\"Usage: /security <plan|scan|status|cancel|scans|cloud|show|import|export|validate|compare|disposition>\",\n\t\t\t\t\truntime,\n\t\t\t\t);\n\t\t}\n\t} catch (error) {\n\t\tawait runtime.output(`Security: ${errorMessage(error)}`);","sourceCodeStart":412,"sourceCodeEnd":448,"githubUrl":"https://github.com/can1357/oh-my-pi/blob/969062200754ea02cfac922e5ebb8c608c079e15/packages/coding-agent/src/slash-commands/helpers/security.ts#L412-L448","documentation":"The /security compare subcommand diffs two security scans and requires exactly two scan ids. handleSecurityCommand throws this when fewer than two non-empty arguments are given to parseCommandArgs, because SecurityStore.compare(before, after) cannot run without both endpoints.","triggerScenarios":"Running `/security compare`, `/security compare <id>` (only one id), or `/security compare \" \"` where an argument is empty after parsing.","commonSituations":"User knows only one scan id, forgets the order of arguments, or pastes ids with a wrong separator so only one token parses.","solutions":["Run `/security compare <before-scan-id> <after-scan-id>` with both ids separated by whitespace","List existing scan ids via the security list/scan subcommands first","Quote ids containing spaces so parseCommandArgs keeps them as single tokens"],"exampleFix":"// before\n/security compare scan-2026-08-01\n// after\n/security compare scan-2026-08-01 scan-2026-08-30","handlingStrategy":"validation","validationCode":"const [before, after] = parseCommandArgs(rest);\nif (!before || !after) throw new Error(\"compare requires <before-scan-id> <after-scan-id>\");","typeGuard":"null","tryCatchPattern":"null","preventionTips":["Supply both scan ids separated by whitespace","Fetch scan ids via the security list/scan subcommands first","Quote ids containing spaces so argument parsing keeps them intact"],"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"}