affaan-m/ECC · error · Error

claim requires --owner

Error message

claim requires --owner <name>.

What it means

CLI adapter guard in claimWorkItemCli: --owner is absent, so the claim operation cannot attribute the work item to an agent or human; the thin wrapper exists specifically to keep this flag-specific message for the command line.

Solutions

  1. Add --owner <name> to the claim command, e.g. item claim <id> --owner alice
  2. Check the command help for the full claim syntax
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at scripts/work-items.js:396 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of affaan-m/ECC@8321021c54 (2026-09-16). Data as JSON: /api/errors/45c0963bc4a0641e. Report an issue: GitHub.

Appendix: source

Thrown at scripts/work-items.js:396

function printGithubSyncResult(payload) {
  console.log(`GitHub sync: ${payload.repo}`);
  console.log(`  Open PRs: ${payload.prCount}`);
  console.log(`  Open issues: ${payload.issueCount}`);
  console.log(`  Closed stale items: ${payload.closedCount}`);
  if (payload.items.length === 0 && payload.closedItems.length === 0) {
    console.log('  Work items changed: none');
    return;
  }
  for (const item of [...payload.items, ...payload.closedItems]) {
    console.log(`  - ${item.id} ${item.status}: ${item.title}`);
  }
}

// Thin CLI adapter over the shared claimWorkItem helper, preserving the
// flag-specific error messages (--owner / --as) for the command line.
function claimWorkItemCli(store, options) {
  if (!options.owner) {
    throw new Error('claim requires --owner <name>.');
  }
  const assigneeKind = options.claimAs ? String(options.claimAs).toLowerCase() : null;
  if (assigneeKind && assigneeKind !== 'agent' && assigneeKind !== 'human') {
    throw new Error("--as must be 'agent' or 'human'.");
  }
  return claimWorkItem(store, {
    id: resolveWorkItemId(options),
    owner: options.owner,
    assigneeKind,
    sessionId: options.sessionId,
    status: options.status
  });
}

async function main() {
  let store = null;

  try {

View on GitHub (pinned to 8321021c54)