can1357/oh-my-pi · warning · Error
--canary and --stable are mutually exclusive
Error message
--canary and --stable are mutually exclusive
What it means
Argument-validation error thrown by parseUpdateArgs when both --canary and --stable are passed to `omp update`. The two flags select mutually exclusive release channels (bleeding-edge vs latest stable), so the updater refuses to guess and fails fast before touching the network.
Source
Thrown at packages/coding-agent/src/cli/update-cli.ts:382
backupPath: string;
expectedVersion: string;
verifyInstalledVersion: (expectedVersion: string) => Promise<InstalledVersionVerification>;
}
/**
* Parse update subcommand arguments.
* Returns undefined if not an update command.
*/
export function parseUpdateArgs(
args: string[],
): { force: boolean; check: boolean; plugins: boolean; channel?: UpdateChannel } | undefined {
if (args.length === 0 || args[0] !== "update") {
return undefined;
}
const canary = args.includes("--canary");
const stable = args.includes("--stable");
if (canary && stable) throw new Error("--canary and --stable are mutually exclusive");
return {
force: args.includes("--force") || args.includes("-f"),
check: args.includes("--check") || args.includes("-c"),
plugins: args.includes("--plugins") || args.includes("-l"),
channel: canary ? "canary" : stable ? "stable" : undefined,
};
}
async function getBunGlobalBinDir(): Promise<string | undefined> {
if (!$which("bun")) return undefined;
try {
const result = await $`bun pm bin -g`.quiet().nothrow();
if (result.exitCode !== 0) return undefined;
const output = result.text().trim();
return output.length > 0 ? output : undefined;
} catch {
return undefined;View on GitHub (pinned to 9690622007)
Solutions
- Pick one channel: run `omp update --canary` OR `omp update --stable`, not both.
- Inspect aliases/functions (`type omp` / `alias | grep omp`) and remove a baked-in channel flag if it collides with the one you pass.
- Use plain `omp update` with no channel flag to keep the default channel.
Example fix
// before $ omp update --canary --stable // Error: --canary and --stable are mutually exclusive // after $ omp update --stable
Defensive patterns
Strategy: validation
Validate before calling
const canary = args.includes("--canary");
const stable = args.includes("--stable");
if (canary && stable) throw new Error("--canary and --stable are mutually exclusive"); Prevention
- Check shell aliases for baked-in channel flags before adding your own
- Pass at most one channel flag
- Omit channel flags entirely to accept the default channel
When it happens
Trigger: `omp update --canary --stable`, `omp update -f --canary --stable`, or scripts/aliases that append a channel flag to a command line that already contains the other.
Common situations: A shell alias like `alias oup='omp update --canary'` combined with a habit of typing `... --stable`; documentation snippets pasted together; scripted update jobs where the channel is interpolated twice.
Related errors
- unknown file type: {value}
- invalid size: {value}
- 2
- invalid --block-size argument '{0}'
- invalid --time-style argument {} Possible values are: - [p
AI-assisted analysis of can1357/oh-my-pi@9690622007 (2026-08-31).
Data as JSON: /api/errors/35561d649224db6b.
Report an issue: GitHub.