{"record":{"id":"635af62949058049","repo":"can1357/oh-my-pi","slug":"canary-and-stable-are-mutually-exclusive-635af6","errorCode":null,"errorMessage":"--canary and --stable are mutually exclusive","messagePattern":"--canary and --stable are mutually exclusive","errorType":"validation","errorClass":"CliUsageError","httpStatus":null,"severity":"error","filePath":"packages/coding-agent/src/commands/update.ts","lineNumber":32,"sourceCode":"\tstatic flags = {\n\t\tforce: Flags.boolean({ char: \"f\", description: \"Force update\", default: false }),\n\t\tcheck: Flags.boolean({ char: \"c\", description: \"Check for updates without installing\", default: false }),\n\t\tplugins: Flags.boolean({ char: \"l\", description: \"Update installed plugins\", default: false }),\n\t\tcanary: Flags.boolean({ description: \"Switch to the canary channel and update\", default: false }),\n\t\tstable: Flags.boolean({ description: \"Switch back to the stable channel\", default: false }),\n\t};\n\n\tstatic examples = [\n\t\t\"omp update\",\n\t\t\"omp update --check\",\n\t\t\"omp update --canary\",\n\t\t\"# If GitHub rate-limits release metadata, set GITHUB_TOKEN or GH_TOKEN\\n  GITHUB_TOKEN=... omp update\",\n\t];\n\n\tasync run(): Promise<void> {\n\t\tconst { flags } = await this.parse(Update);\n\t\tawait initTheme();\n\t\tif (flags.canary && flags.stable) throw new CliUsageError(\"--canary and --stable are mutually exclusive\");\n\t\tif (flags.plugins) {\n\t\t\tawait pluginCli.runPluginCommand({ action: \"upgrade\", args: [], flags: {} });\n\t\t} else {\n\t\t\tawait updateCli.runUpdateCommand({\n\t\t\t\tforce: flags.force,\n\t\t\t\tcheck: flags.check,\n\t\t\t\tchannel: flags.canary ? \"canary\" : flags.stable ? \"stable\" : undefined,\n\t\t\t});\n\t\t}\n\t}\n}\n","sourceCodeStart":14,"sourceCodeEnd":44,"githubUrl":"https://github.com/can1357/oh-my-pi/blob/969062200754ea02cfac922e5ebb8c608c079e15/packages/coding-agent/src/commands/update.ts#L14-L44","documentation":"omp update can install either the canary (pre-release) or the stable channel, but not both. Passing --canary and --stable together is ambiguous, so the command throws a CliUsageError before any update logic runs.","triggerScenarios":"'omp update --canary --stable'; wrapper scripts that append --stable while a user adds --canary (or vice versa).","commonSituations":"Aliases/scripts encoding a channel preference that collide with a manually typed opposite flag; CI configs merging two channel inputs.","solutions":["Pass only one channel flag: --canary OR --stable","If neither is passed, the command uses its default channel","Fix wrapper scripts/aliases so they do not hardcode a conflicting channel flag"],"exampleFix":"// before\nomp update --canary --stable\n// after\nomp update --canary","handlingStrategy":"validation","validationCode":"if (flags.canary && flags.stable) {\n  throw new Error('--canary and --stable are mutually exclusive');\n}","typeGuard":null,"tryCatchPattern":"try {\n  await Update.run(rawArgs);\n} catch (err) {\n  if (err instanceof CliUsageError && err.message.includes('--canary')) {\n    console.error('Pick one channel: --canary OR --stable.');\n    process.exitCode = 1;\n  } else throw err;\n}","preventionTips":["Store the channel as one enum value (canary|stable|default), not two booleans","Audit aliases/scripts for hardcoded channel flags","Resolve channel conflicts explicitly before spawning the CLI"],"tags":["cli","usage","conflicting-flags"],"backgroundTag":"mutually-exclusive-flags","analyzedSha":"969062200754ea02cfac922e5ebb8c608c079e15","analyzedAt":"2026-08-31T10:29:35.737Z","schemaVersion":2},"datasetVersion":"2026-08-31T14:17:45.589Z"}