OtterMind/Chat2DB · error · Error

Usage: node script/github/issue-claim.js <event|cleanup|swee

Error message

Usage: node script/github/issue-claim.js <event|cleanup|sweep>

What it means

Error "Usage: node script/github/issue-claim.js <event|cleanup|sweep>" thrown in OtterMind/Chat2DB.

Source

Thrown at script/github/issue-claim.js:732

    if (!process.env.GITHUB_EVENT_PATH) throw new Error('GITHUB_EVENT_PATH is required.');
    const event = JSON.parse(fs.readFileSync(process.env.GITHUB_EVENT_PATH, 'utf8'));
    const result = await processEvent({ client, policy, event });
    console.log(`Claim command result: ${result}`);
    return;
  }
  if (mode === 'sweep') {
    const released = await sweepExpiredClaims({ client, policy });
    console.log(`Released ${released} expired claim(s).`);
    return;
  }
  if (mode === 'cleanup') {
    if (!process.env.GITHUB_EVENT_PATH) throw new Error('GITHUB_EVENT_PATH is required.');
    const event = JSON.parse(fs.readFileSync(process.env.GITHUB_EVENT_PATH, 'utf8'));
    const result = await cleanupClaim({ client, policy, event });
    console.log(`Claim cleanup result: ${result}`);
    return;
  }
  throw new Error('Usage: node script/github/issue-claim.js <event|cleanup|sweep>');
}

if (require.main === module) {
  main().catch((error) => {
    console.error(error.stack || error.message);
    process.exitCode = 1;
  });
}

module.exports = {
  ACTIVE_STATUS,
  GitHubClient,
  addDays,
  canManageClaims,
  cleanupClaim,
  emptyState,
  isEligibleIssue,
  isLeaseExpired,

View on GitHub (pinned to 5ee1e990e7)

Solutions

  1. Run the script with exactly one mode argument: node script/github/issue-claim.js <event|cleanup|sweep>
  2. In GitHub Actions, set the mode from the workflow event instead of calling the script without arguments.

When it happens

Trigger: The CLI was invoked with no arguments or an unrecognized mode, so process.argv did not match event, cleanup, or sweep.

Common situations: See trigger scenarios.


AI-assisted analysis of OtterMind/Chat2DB@5ee1e990e7 (2026-08-14). Data as JSON: /api/errors/5515747c5d8c31b9. Report an issue: GitHub.