affaan-m/ECC · error · Error

The all/* harness selection cannot be combined with other se

Error message

The all/* harness selection cannot be combined with other selections

What it means

Thrown by normalizeHarnessSelection() when the input contains both an 'all' (or '*') token and at least one explicit harness token. The selector is mutually exclusive: 'all' already means every guided harness, so combining is ambiguous and rejected.

Source

Thrown at scripts/lib/harness-capabilities.js:323

}

function tokenizeSelection(selection) {
  const values = Array.isArray(selection) ? selection : [selection];
  return values.flatMap(value => (
    typeof value === 'string' ? value.split(',') : []
  )).map(value => value.trim()).filter(Boolean);
}

function normalizeHarnessSelection(selection) {
  const tokens = tokenizeSelection(selection);
  if (tokens.length === 0 || tokens.every(token => normalizeLookupToken(token) === 'none')) {
    throw new Error('At least one guided harness must be selected');
  }

  const allTokens = tokens.filter(token => ['all', '*'].includes(normalizeLookupToken(token)));
  const explicitTokens = tokens.filter(token => !['all', '*'].includes(normalizeLookupToken(token)));
  if (allTokens.length > 0 && explicitTokens.length > 0) {
    throw new Error('The all/* harness selection cannot be combined with other selections');
  }
  if (allTokens.length > 0) {
    return GUIDED_HARNESS_IDS.slice();
  }

  const selected = new Set();
  for (const token of tokens) {
    const normalizedToken = normalizeLookupToken(token);
    const menuIndex = /^\d+$/.test(normalizedToken) ? Number(normalizedToken) - 1 : -1;
    const harness = menuIndex >= 0
      ? listGuidedHarnesses()[menuIndex] || null
      : getHarnessCapability(token);

    if (!harness) {
      throw new Error(`Unknown guided harness selection: ${token}`);
    }
    if (!harness.guidedReady) {
      throw new Error(`${harness.label} is an advanced harness and is not guided-ready`);

View on GitHub (pinned to 01e15490f0)

Solutions

  1. Use either 'all'/'*' on its own OR a comma-separated explicit list, not both.
  2. If you wanted 'all plus extras' just use 'all' (it already returns every guided harness).
  3. Inspect the caller: ensure CLI default and user flag are not both appended to the token list.

Example fix

// before
normalizeHarnessSelection('all,claude,codex');

// after
normalizeHarnessSelection('all');
// or
normalizeHarnessSelection('claude,codex');
Defensive patterns

Strategy: validation

Validate before calling

function isExclusiveSelection(sel) {
  const tokens = (Array.isArray(sel) ? sel : String(sel || '').split(','))
    .map(t => t.trim().toLowerCase()).filter(Boolean);
  const hasAll = tokens.some(t => t === 'all' || t === '*');
  const hasExplicit = tokens.some(t => t !== 'all' && t !== '*');
  return !(hasAll && hasExplicit);
}
if (!isExclusiveSelection(sel)) throw new Error('Pass either "all" or explicit ids');

Try / catch

try {
  return normalizeHarnessSelection(sel);
} catch (err) {
  if (/cannot be combined/.test(err.message)) {
    // pick 'all' as the safer superset
    return normalizeHarnessSelection('all');
  }
  throw err;
}

Prevention

When it happens

Trigger: normalizeHarnessSelection receives tokens like ['all', 'claude'], ['*', 'codex'], or 'all,claude'. allTokens.length > 0 AND explicitTokens.length > 0 at harness-capabilities.js:322.

Common situations: User typed --harness all,claude thinking it would add to the set; config file lists 'all' alongside specific ids; a CLI default of 'all' was concatenated with a user-provided explicit selection.

Related errors


AI-assisted analysis of affaan-m/ECC@01e15490f0 (2026-08-13). Data as JSON: /api/errors/1a42aecfad6d74fb. Report an issue: GitHub.