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
- Pass the work item id: moveWorkItem(store, { id, lane }).
- Resolve the id via the store lookup before moving.
- 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
- Bind item ids explicitly in UI event handlers and verify at dev time.
- Validate the mutation payload shape before calling.
- Guard call sites: skip no-op moves when id is absent.
- Log the full payload when a move fails to spot dropped fields.
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
- claim requires an owner.
- a claim token is required
- An install component ID is required
- assigneeKind must be 'agent' or 'human'.
- Invalid lane ' '. Expected one of .
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)