affaan-m/ECC · error · Error

Missing value for --limit

Error message

Missing value for --limit

What it means

Thrown by scripts/status.js when --limit appears in argv but no numeric value follows it. The parser stores the next token into limit (defaulting the field to 5), and if the token is falsy the post-parse guard `args.includes('--limit') && !parsed.limit` fires. --limit controls how many active sessions, governance events, and work items are fetched, so an empty value cannot be used as a row count.

Source

Thrown at scripts/status.js:71

    } else {
      throw new Error(`Unknown argument: ${arg}`);
    }
  }

  if (parsed.json && parsed.markdown) {
    throw new Error('Choose only one output format: --json or --markdown');
  }

  if (args.includes('--db') && !parsed.dbPath) {
    throw new Error('Missing value for --db');
  }

  if (args.includes('--write') && !parsed.writePath) {
    throw new Error('Missing value for --write');
  }

  if (args.includes('--limit') && !parsed.limit) {
    throw new Error('Missing value for --limit');
  }

  return parsed;
}

function printActiveSessions(section) {
  console.log(`Active sessions: ${section.activeCount}`);
  if (section.sessions.length === 0) {
    console.log('  - none');
    return;
  }

  for (const session of section.sessions) {
    console.log(`  - ${session.id} [${session.harness}/${session.adapterId}] ${session.state}`);
    console.log(`    Repo: ${session.repoRoot || '(unknown)'}`);
    console.log(`    Started: ${session.startedAt || '(unknown)'}`);
    console.log(`    Workers: ${session.workerCount}`);
  }

View on GitHub (pinned to 01e15490f0)

Solutions

  1. Supply a positive integer: `node scripts/status.js --limit 20`.
  2. If the default of 5 is acceptable, omit --limit entirely.
  3. Fix the wrapper so it only appends `--limit <n>` when the count variable holds a valid number.

Example fix

// before
node scripts/status.js --limit

// after
node scripts/status.js --limit 20
Defensive patterns

Strategy: validation

Validate before calling

const rawLimit = process.env.ECC_STATUS_LIMIT;
const limit = Number.parseInt(rawLimit, 10);
const args = ['--json'];
if (Number.isFinite(limit) && limit > 0) {
  args.push('--limit', String(limit));
}
// omit --limit entirely if the env var is missing or invalid

Prevention

When it happens

Trigger: `node scripts/status.js --limit` (flag is last token); a wrapper appending `--limit $COUNT` where $COUNT is empty or unset.

Common situations: A configurable row-count variable that is conditionally set and left empty in some runs; truncating a command while editing and leaving --limit dangling; copying a command template whose placeholder was never filled.

Related errors


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