Yeachan-Heo/oh-my-codex · error · Error
Unknown cancel argument: ${unsupported}
Error message
Unknown cancel argument: ${unsupported} What it means
The cancel command accepts at most one argument, and that argument must be --force. Any other argument (or a second argument) triggers this error naming the first unsupported token. This keeps the cancellation surface intentionally minimal and prevents accidental broad or misparsed invocations.
Source
Thrown at src/cli/index.ts:8369
assertExactSkillOwner(entry, authority, entryPath);
}
}
interface CancellationTestFaults {
writeFailureMode?: string;
rollbackFailureMode?: string;
}
async function cancelModes(
args: string[] = [],
options: { cwd?: string; testFaults?: CancellationTestFaults } = {},
): Promise<void> {
const cwd = options.cwd ?? process.cwd();
const nowIso = new Date().toISOString();
if (args.length > 1 || args.some((arg) => arg !== "--force")) {
const unsupported = args.find((arg) => arg !== "--force") ?? args[1] ?? "";
throw new Error(unsupported === "--all"
? "omx cancel --all is not supported; broad workspace cancellation requires a separate command."
: `Unknown cancel argument: ${unsupported}`);
}
const force = args.length === 1;
try {
const writableScope = await resolveWritableStateScope(cwd);
const baseStateDir = getBaseStateDir(cwd);
const exactAuthority = writableScope.source === "session"
? await resolveExactSessionCancellationAuthority(cwd, baseStateDir, writableScope.sessionId)
: undefined;
const expectedOwnerIds = collectCancellationOwnerIds(baseStateDir, writableScope.sessionId);
const loadStates = async (
refs: ModeStateFileRef[],
authorityRoot: string,
ownerIds: Set<string> = expectedOwnerIds,
) => {View on GitHub (pinned to 3ad79a8a6f)
Solutions
- Remove the unsupported argument; this version supports only an optional --force
- Check omx cancel --help for the exact accepted arguments in your version
- Upgrade the CLI if a newer version supports the argument you're using
- Use the dedicated command for the operation you intended
Example fix
# before omx cancel session-123 # after omx cancel --force
Defensive patterns
Strategy: validation
Validate before calling
function cancelArgsValid(args: string[]): boolean {
return args.length <= 1 && args.every((a) => a === "--force");
} Try / catch
try {
await cancel(args, options);
} catch (err) {
if (err instanceof Error && err.message.startsWith("Unknown cancel argument")) {
// surface usage help to the user
} else throw err;
} Prevention
- Whitelist arguments to only --force before invoking cancel
- Validate args.length <= 1 in wrapper scripts
When it happens
Trigger: Running cancel with an unknown flag like --quiet, a target name as a bare argument, or two arguments (e.g. omx cancel --force --force); the find() picks the first non---force token, or args[1] when both are --force.
Common situations: Passing a session/target ID that this version doesn't accept positionally; typos in flags; scripts written against a different CLI version with richer arguments.
Related errors
- omx cancel --all is not supported; broad workspace cancellat
- --to must be ralplan or ultragoal.
- --keep-policy must be one of: score_improvement, pass_only
- Unknown capabilities subcommand: ${parsed.subcommand}
- Unknown capabilities option: ${arg}
AI-assisted analysis of Yeachan-Heo/oh-my-codex@3ad79a8a6f (2026-08-27).
Data as JSON: /api/errors/926a859332fa9fe0.
Report an issue: GitHub.