jackwener/OpenCLI · error · ArgumentError

${capabilities.plan || 'current'} plan allows at most ${capa

Error message

${capabilities.plan || 'current'} plan allows at most ${capabilities.repeatLimit} repeat/permutation jobs

What it means

The resolved repeat count (structured args.repeat or in-prompt --r/--repeat, defaulting to 1) is capped by the account's plan via capabilities.repeatLimit. This error is thrown when the requested repeat exceeds the current subscription plan's limit (e.g. Basic allows fewer repeat jobs than Pro/Mega).

Source

Thrown at clis/midjourney/capabilities.js:246

    if (![0.25, 0.5, 1].includes(normalizedQuality)) {
      throw new ArgumentError('--quality must be 0.25, 0.5, or 1 for supported legacy models');
    }
  }

  const rawRepeat = promptParamValue(prompt, ['r', 'repeat']);
  const structuredRepeat = args.repeat == null || args.repeat === '' ? null : Number(args.repeat);
  if (structuredRepeat != null && (!Number.isInteger(structuredRepeat) || structuredRepeat < 1)) {
    throw new ArgumentError('--repeat must be a positive integer');
  }
  if (rawRepeat != null && (!/^\d+$/.test(rawRepeat) || Number(rawRepeat) < 1)) {
    throw new ArgumentError('--repeat in the prompt must be a positive integer');
  }
  if (structuredRepeat != null && rawRepeat != null && structuredRepeat !== Number(rawRepeat)) {
    throw new ArgumentError(`--repeat conflicts with the prompt (${structuredRepeat} vs ${rawRepeat})`);
  }
  const repeat = structuredRepeat ?? (rawRepeat == null ? 1 : Number(rawRepeat));
  if (repeat > capabilities.repeatLimit) {
    throw new ArgumentError(`${capabilities.plan || 'current'} plan allows at most ${capabilities.repeatLimit} repeat/permutation jobs`);
  }

  let perJobMinutes = hasOmniReference || promptHasFlag(prompt, ['oref'])
    ? GPU_COST_MINUTES.omni
    : resolution === 'hd'
      ? GPU_COST_MINUTES.imageHd
      : GPU_COST_MINUTES.imageSd;
  if (promptHasFlag(prompt, ['draft'])) perJobMinutes /= 2;
  // The current web service charged a full SD batch for a live V6 --q 0.5
  // job. Keep the cost guard conservative instead of applying historical
  // quality discounts that are no longer reflected in account credits.
  if (speed === 'turbo') perJobMinutes *= 2;
  // Relax jobs do not consume the subscription's Fast GPU minute balance.
  // Keep the guard and reported estimate aligned with the quota it protects.
  if (speed === 'relax') perJobMinutes = 0;
  const estimatedMinutes = Number((perJobMinutes * repeat).toFixed(2));

  return {

View on GitHub (pinned to 49907e53dc)

Solutions

  1. Lower repeat to at most capabilities.repeatLimit for the account's plan (check the message for the exact cap).
  2. Upgrade the Midjourney subscription plan (Basic -> Standard -> Pro -> Mega) for a higher repeat limit.
  3. Split the work into multiple sequential calls, each within the plan's repeat limit.
  4. Verify capabilities/plan with the account-info/plan endpoint before issuing large batches.

Example fix

// before
await midjourney.generate({ prompt: 'a cat', repeat: 8 }); // Basic plan, limit 4
// after
await midjourney.generate({ prompt: 'a cat', repeat: 4 });
Defensive patterns

Strategy: validation

Validate before calling

const repeat = Number(args.repeat ?? 1);
const limit = await midjourney.capabilities(); // fetch plan limits
if (repeat > limit.repeatLimit) {
  throw new Error(`repeat ${repeat} exceeds plan limit ${limit.repeatLimit}`);
}

Type guard

function isWithinRepeatLimit(repeat, capabilities) {
  return Number.isInteger(repeat) && repeat >= 1 && repeat <= (capabilities?.repeatLimit ?? Infinity);
}

Try / catch

try {
  return await midjourney.generate({ prompt, repeat });
} catch (err) {
  if (err instanceof ArgumentError && /plan allows at most \d+ repeat/.test(err.message)) {
    const limit = Number(err.message.match(/at most (\d+)/)[1]);
    return midjourney.generate({ prompt, repeat: Math.min(repeat, limit) });
  }
  throw err;
}

Prevention

When it happens

Trigger: Calling generate/plan with repeat: 6 on a plan whose repeatLimit is 4 (e.g. Basic plan), via args.repeat or an in-prompt '--r 6'. The exact message names the plan and its limit.

Common situations: Running high-fanout batches on a Basic plan, copying example commands with --r 8 from users on Pro, or upgrading/lapsing a subscription so capabilities reflect a lower tier.

Related errors


AI-assisted analysis of jackwener/OpenCLI@49907e53dc (2026-08-29). Data as JSON: /api/errors/2558aa707fdca629. Report an issue: GitHub.