{"record":{"id":"719cd9bdb2a9aaf1","repo":"EveryInc/compound-engineering-plugin","slug":"unknown-permissions-mode-permissions","errorCode":null,"errorMessage":"Unknown permissions mode: ${permissions}","messagePattern":"Unknown permissions mode: (.+?)","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"src/commands/convert.ts","lineNumber":80,"sourceCode":"    },\n    inferTemperature: {\n      type: \"boolean\",\n      default: true,\n      description: \"Infer agent temperature from name/description\",\n    },\n    includeSkills: {\n      type: \"boolean\",\n      default: false,\n      alias: \"include-skills\",\n      description: \"For --to codex only: also emit skills and commands. Default is agents-only, the recommended pairing with `codex plugin install`. Set this flag for a legacy / standalone install without Codex native plugin install. Ignored by other targets.\",\n    },\n  },\n  async run({ args }) {\n    const targetName = String(args.to)\n\n    const permissions = String(args.permissions)\n    if (!permissionModes.includes(permissions as PermissionMode)) {\n      throw new Error(`Unknown permissions mode: ${permissions}`)\n    }\n\n    const plugin = await loadClaudePlugin(String(args.source))\n    const outputRoot = resolveOutputRoot(args.output)\n    const hasExplicitOutput = Boolean(args.output && String(args.output).trim())\n    const codexHome = resolveCodexHome(args.codexHome)\n    const piHome = resolveTargetHome(args.piHome, path.join(os.homedir(), \".pi\", \"agent\"))\n\n    const options: ClaudeToOpenCodeOptions = {\n      agentMode: String(args.agentMode) === \"primary\" ? \"primary\" : \"subagent\",\n      inferTemperature: Boolean(args.inferTemperature),\n      permissions: permissions as PermissionMode,\n      codexIncludeSkills: Boolean(args.includeSkills),\n    }\n\n    if (targetName === \"all\") {\n      const detected = await detectInstalledTools()\n      const activeTargets = detected.filter((t) => t.detected && targets[t.name]?.implemented)","sourceCodeStart":62,"sourceCodeEnd":98,"githubUrl":"https://github.com/EveryInc/compound-engineering-plugin/blob/c9c10f8c75412c7232cb2bd663e5fd1cea98d84e/src/commands/convert.ts#L62-L98","documentation":"`convert` validates `--permissions` against the known permission modes — \"none\", \"broad\", \"from-commands\" — before doing any conversion work. An unrecognized value throws this error immediately at the start of `run`, before the plugin is even loaded.","triggerScenarios":"Calling convert with `--permissions` set to anything other than none/broad/from-commands: typos (\"permissive\", \"nonee\"), wrong casing (\"None\"), or inventing a mode that doesn't exist.","commonSituations":"Copy-pasting flags from another tool's docs; guessing a mode name from its description; scripting the CLI with a stale value from an older version whose mode set differed; shell scripts interpolating an empty or default string into the flag.","solutions":["Pass one of the exact modes: --permissions none, --permissions broad, or --permissions from-commands.","Fix casing/typos — matching is exact, case-sensitive string inclusion.","Check `convert --help` for the current list of supported permission modes in your installed version."],"exampleFix":"// before\nbun run src/index.ts convert --to codex --permissions permissive\n// Error: Unknown permissions mode: permissive\n\n// after\nbun run src/index.ts convert --to codex --permissions from-commands","handlingStrategy":"validation","validationCode":"const PERMISSION_MODES = [\"none\", \"broad\", \"from-commands\"] as const\nconst mode = process.env.PERMISSIONS ?? \"broad\"\nif (!(PERMISSION_MODES as readonly string[]).includes(mode)) {\n  throw new Error(`--permissions must be one of ${PERMISSION_MODES.join(\" | \")}, got: ${mode}`)\n}","typeGuard":"type PermissionMode = \"none\" | \"broad\" | \"from-commands\"\nfunction isPermissionMode(v: string): v is PermissionMode {\n  return v === \"none\" || v === \"broad\" || v === \"from-commands\"\n}","tryCatchPattern":"try {\n  await convert({ to, permissions })\n} catch (e) {\n  if (e instanceof Error && e.message.startsWith(\"Unknown permissions mode:\")) {\n    console.error(`${e.message} — valid modes: none, broad, from-commands`)\n    process.exitCode = 2\n  } else throw e\n}","preventionTips":["Treat the three mode strings as an enum; never free-form text.","Beware shell interpolation: `--permissions $MODE` fails silently-ish when MODE is empty — default it.","Match hyphenation exactly: \"from-commands\", not \"from commands\" or \"fromCommands\"."],"tags":["cli","validation","argument-parsing"],"backgroundTag":"invalid-enum-argument","analyzedSha":"c9c10f8c75412c7232cb2bd663e5fd1cea98d84e","analyzedAt":"2026-08-31T15:18:07.959Z","schemaVersion":2},"datasetVersion":"2026-08-31T19:17:28.585Z"}