{"record":{"id":"926a859332fa9fe0","repo":"Yeachan-Heo/oh-my-codex","slug":"unknown-cancel-argument-unsupported","errorCode":null,"errorMessage":"Unknown cancel argument: ${unsupported}","messagePattern":"Unknown cancel argument: (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"src/cli/index.ts","lineNumber":8369,"sourceCode":"    assertExactSkillOwner(entry, authority, entryPath);\n  }\n}\n\ninterface CancellationTestFaults {\n  writeFailureMode?: string;\n  rollbackFailureMode?: string;\n}\n\nasync function cancelModes(\n  args: string[] = [],\n  options: { cwd?: string; testFaults?: CancellationTestFaults } = {},\n): Promise<void> {\n\n  const cwd = options.cwd ?? process.cwd();\n  const nowIso = new Date().toISOString();\n  if (args.length > 1 || args.some((arg) => arg !== \"--force\")) {\n    const unsupported = args.find((arg) => arg !== \"--force\") ?? args[1] ?? \"\";\n    throw new Error(unsupported === \"--all\"\n      ? \"omx cancel --all is not supported; broad workspace cancellation requires a separate command.\"\n      : `Unknown cancel argument: ${unsupported}`);\n  }\n  const force = args.length === 1;\n  try {\n    const writableScope = await resolveWritableStateScope(cwd);\n    const baseStateDir = getBaseStateDir(cwd);\n    const exactAuthority = writableScope.source === \"session\"\n      ? await resolveExactSessionCancellationAuthority(cwd, baseStateDir, writableScope.sessionId)\n      : undefined;\n    const expectedOwnerIds = collectCancellationOwnerIds(baseStateDir, writableScope.sessionId);\n\n\n    const loadStates = async (\n      refs: ModeStateFileRef[],\n      authorityRoot: string,\n      ownerIds: Set<string> = expectedOwnerIds,\n    ) => {","sourceCodeStart":8351,"sourceCodeEnd":8387,"githubUrl":"https://github.com/Yeachan-Heo/oh-my-codex/blob/3ad79a8a6fe6e95fdbb8c00e40716fffe4011ce2/src/cli/index.ts#L8351-L8387","documentation":"The cancel command accepts at most one argument, and that argument must be --force. Any other argument (or a second argument) triggers this error naming the first unsupported token. This keeps the cancellation surface intentionally minimal and prevents accidental broad or misparsed invocations.","triggerScenarios":"Running cancel with an unknown flag like --quiet, a target name as a bare argument, or two arguments (e.g. omx cancel --force --force); the find() picks the first non---force token, or args[1] when both are --force.","commonSituations":"Passing a session/target ID that this version doesn't accept positionally; typos in flags; scripts written against a different CLI version with richer arguments.","solutions":["Remove the unsupported argument; this version supports only an optional --force","Check omx cancel --help for the exact accepted arguments in your version","Upgrade the CLI if a newer version supports the argument you're using","Use the dedicated command for the operation you intended"],"exampleFix":"# before\nomx cancel session-123\n# after\nomx cancel --force","handlingStrategy":"validation","validationCode":"function cancelArgsValid(args: string[]): boolean {\n  return args.length <= 1 && args.every((a) => a === \"--force\");\n}","typeGuard":null,"tryCatchPattern":"try {\n  await cancel(args, options);\n} catch (err) {\n  if (err instanceof Error && err.message.startsWith(\"Unknown cancel argument\")) {\n    // surface usage help to the user\n  } else throw err;\n}","preventionTips":["Whitelist arguments to only --force before invoking cancel","Validate args.length <= 1 in wrapper scripts"],"tags":["cli","invalid-argument","cancel","argument-validation"],"backgroundTag":"invalid-command-arguments","analyzedSha":"3ad79a8a6fe6e95fdbb8c00e40716fffe4011ce2","analyzedAt":"2026-08-27T22:18:39.783Z","schemaVersion":2},"datasetVersion":"2026-08-28T00:17:15.603Z"}