{"record":{"id":"edc7c555b59882a4","repo":"tinyhumansai/openhuman","slug":"invalid-paramname-must-be-an-array-of-ids","errorCode":null,"errorMessage":"Invalid ${paramName}: must be an array of IDs.","messagePattern":"Invalid (.+?): must be an array of IDs\\.","errorType":"validation","errorClass":"ValidationError","httpStatus":null,"severity":"error","filePath":"app/src/lib/mcp/validation.ts","lineNumber":56,"sourceCode":"      return value.startsWith('@') ? value : `@${value}`;\n    }\n\n    throw new ValidationError(\n      `Invalid ${paramName}: '${value}'. Must be a valid integer ID or a username string.`\n    );\n  }\n\n  throw new ValidationError(\n    `Invalid ${paramName}: ${String(value)}. Type must be an integer or a string.`\n  );\n}\n\n/**\n * Validate list of IDs\n */\nexport function validateIdList(value: unknown, paramName: string): Array<number | string> {\n  if (!Array.isArray(value)) {\n    throw new ValidationError(`Invalid ${paramName}: must be an array of IDs.`);\n  }\n\n  return value.map((item: unknown, index: number) => {\n    try {\n      return validateId(item, `${paramName}[${index}]`);\n    } catch (error) {\n      if (error instanceof ValidationError) {\n        throw error;\n      }\n      const errorMsg = error instanceof Error ? error.message : String(error);\n      throw new ValidationError(`Invalid ${paramName}[${index}]: ${errorMsg}`);\n    }\n  });\n}\n\n/**\n * Validate a positive integer parameter (e.g. message IDs)\n */","sourceCodeStart":38,"sourceCodeEnd":74,"githubUrl":"https://github.com/tinyhumansai/openhuman/blob/a221052e0df5b1f7598fceba7329fd1af95d6699/app/src/lib/mcp/validation.ts#L38-L74","documentation":"Dispatch error from the `openhuman subconscious` CLI router (src/core/subconscious_cli.rs:19). The first token after `subconscious` is matched against exactly two subcommands — `tick` and `status` — and anything else falls into the catch-all arm. Help (-h/--help/help) is only recognized at args[0]; there is no help token inside either subcommand's parser.","triggerScenarios":"`openhuman subconscious run` (no such subcommand); `openhuman subconscious -v` (flags not accepted in the subcommand position); `openhuman subconscious monitor` from a script written for a different daemon's CLI.","commonSituations":"Scripts or aliases assuming a richer subconscious surface; typos; passing global flags before the subcommand.","solutions":["Use only `tick` or `status`: `openhuman subconscious tick --mode simple`","Run `openhuman subconscious --help` (top level) for the full surface","Fix scripts to validate the first token against {tick, status}"],"exampleFix":"# before\nopenhuman subconscious run --mode aggressive\n# after\nopenhuman subconscious tick --mode aggressive","handlingStrategy":"validation","validationCode":"# bash: validate the subconscious subcommand first\ncase \"${1:-}\" in tick|status) ;; *) echo \"unknown subconscious subcommand '${1:-}'\" >&2; openhuman subconscious --help >&2; exit 2;; esac\nopenhuman subconscious \"$@\"","typeGuard":"is_known_subconscious_sub() { case \"$1\" in tick|status) return 0;; *) return 1;; esac; }","tryCatchPattern":"if ! out=$(openhuman subconscious \"$@\" 2>&1); then\n  case \"$out\" in *\"unknown subconscious subcommand\"*) openhuman subconscious --help >&2; exit 2;; esac\n  printf '%s\\n' \"$out\" >&2; exit 1\nfi","preventionTips":["The surface is exactly {tick, status} — validate wrappers against it","Ask for help at the top level (`openhuman subconscious --help`), not per-subcommand"],"tags":["cli","usage","argument-parsing","subconscious"],"backgroundTag":null,"analyzedSha":"a221052e0df5b1f7598fceba7329fd1af95d6699","analyzedAt":"2026-08-16T12:47:06.542Z","schemaVersion":2},"datasetVersion":"2026-08-16T13:17:31.715Z"}