{"record":{"id":"4e10e9bda231e279","repo":"openai/codex-plugin-cc","slug":"unknown-subcommand-subcommand","errorCode":null,"errorMessage":"Unknown subcommand: ${subcommand}","messagePattern":"Unknown subcommand: (.+?)","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"plugins/codex/scripts/codex-companion.mjs","lineNumber":1065,"sourceCode":"      await handleTransfer(argv);\n      break;\n    case \"task-worker\":\n      await handleTaskWorker(argv);\n      break;\n    case \"status\":\n      await handleStatus(argv);\n      break;\n    case \"result\":\n      handleResult(argv);\n      break;\n    case \"task-resume-candidate\":\n      handleTaskResumeCandidate(argv);\n      break;\n    case \"cancel\":\n      await handleCancel(argv);\n      break;\n    default:\n      throw new Error(`Unknown subcommand: ${subcommand}`);\n  }\n}\n\nmain().catch((error) => {\n  const message = error instanceof Error ? error.message : String(error);\n  process.stderr.write(`${message}\\n`);\n  process.exitCode = 1;\n});\n","sourceCodeStart":1047,"sourceCodeEnd":1074,"githubUrl":"https://github.com/openai/codex-plugin-cc/blob/db52e28f4d9ded852ab3942cea316258ae4ef346/plugins/codex/scripts/codex-companion.mjs#L1047-L1074","documentation":"main() dispatches on the first positional (subcommand) across a fixed switch: setup, review, adversarial-review, task, transfer, task-worker, status, result, task-resume-candidate, cancel. The default case throws Unknown subcommand with the offending value. The top-level catch prints the message to stderr and sets exitCode 1. 'help'/'--help' are handled before the switch.","triggerScenarios":"Typing `codex-companion.mjs revew`, an unsupported verb, or passing a flag as the first positional so it becomes the subcommand.","commonSituations":"Typo, outdated docs referencing a renamed subcommand, or a wrapper that forwards an unexpected token.","solutions":["Run with no args or 'help' to printUsage and see the valid subcommands.","Correct the typo to one of: setup, review, adversarial-review, task, transfer, status, result, cancel, task-worker, task-resume-candidate.","Update any wrapper or alias referencing a renamed command."],"exampleFix":"// before\ncodex-companion.mjs revew\n// after\ncodex-companion.mjs review","handlingStrategy":"validation","validationCode":"const KNOWN = new Set(['setup','review','adversarial-review','task','transfer','task-worker','status','result','task-resume-candidate','cancel']);\nif (!KNOWN.has(subcommand)) { printUsage(); process.exit(2); }","typeGuard":"/** @param {string} s @returns {boolean} */\nfunction isKnownSubcommand(s) { return KNOWN.has(s); }","tryCatchPattern":null,"preventionTips":["Run 'help' to list subcommands when unsure.","Keep wrappers in sync with the current command set."],"tags":["cli","usage","dispatch"],"backgroundTag":null,"analyzedSha":"db52e28f4d9ded852ab3942cea316258ae4ef346","analyzedAt":"2026-08-13T05:13:20.855Z","schemaVersion":2},"datasetVersion":"2026-08-13T09:17:06.757Z"}