affaan-m/ECC · error · Error

move requires a work item id.

Error message

move requires a work item id.

What it means

moveWorkItem in the control-pane store requires the id of the work item to move to a kanban lane (ready|running|blocked|done); thrown when the id property of the input object is falsy, before the lane is even validated.

Solutions

  1. Pass the work item id: moveWorkItem(store, { id, lane }).
  2. Resolve the id via the store lookup before moving.
  3. Fix callers that forward an unset id from CLI parsing.

Example fix

// before
moveWorkItem(store, { lane: 'done' });
// after
moveWorkItem(store, { id: 'item-42', lane: 'done' });
Defensive patterns

Strategy: validation

Validate before calling

if (!id || typeof id !== 'string' || !id.trim()) {
  throw new Error('moveWorkItem requires a non-empty id');
}

Type guard

function hasId(args) { return typeof args?.id === 'string' && args.id.trim().length > 0; }

Try / catch

try { moveWorkItem(store, { id, lane }); } catch (e) {
  if (e.message === 'move requires a work item id.') console.error('Missing id in move payload:', { id, lane });
  else throw e;
}

Prevention

When it happens

Trigger: moveWorkItem(store, { lane: 'done' }) with id omitted, null, or empty string — UI button without bound id, CLI call missing the id argument, or destructuring a payload where the id key was named differently.

Common situations: Event handlers wiring drag-drop that lose the item id; scripts iterating a list where one record lacks id; CLI positional args off by one so id lands in lane or is dropped.

Understand the failure class

Background: "missing required argument" and "the following required arguments were not provided": what required-argument errors mean and how to fix them — this error's family across 20 libraries.

Related errors


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

Appendix: source

Thrown at scripts/lib/control-pane/work-item-mutations.js:91

    metadata.assigneeKind = kind;
  }
  const item = store.upsertWorkItem({
    ...target,
    owner,
    sessionId: sessionId ?? target.sessionId ?? null,
    status: status ?? 'running',
    metadata,
    updatedAt: new Date().toISOString()
  });
  return { claimed: true, item };
}

/**
 * Move a work item to a kanban lane (ready | running | blocked | done).
 */
function moveWorkItem(store, { id, lane } = {}) {
  if (!id) {
    throw new Error('move requires a work item id.');
  }
  const laneKey = String(lane || '')
    .trim()
    .toLowerCase();
  if (!VALID_LANES.has(laneKey)) {
    throw new Error(`Invalid lane '${lane}'. Expected one of ${[...VALID_LANES].join(', ')}.`);
  }
  const target = store.getWorkItemById(id);
  if (!target) {
    throw new Error(`Work item not found: ${id}`);
  }
  const item = store.upsertWorkItem({
    ...target,
    status: LANE_TO_STATUS[laneKey],
    updatedAt: new Date().toISOString()
  });
  return { moved: true, item };
}

View on GitHub (pinned to 8321021c54)