affaan-m/ECC · error · Error
claim requires --owner <name>.
Error message
claim requires --owner <name>.
What it means
Thrown by claimWorkItemCli() (the CLI adapter around the shared claimWorkItem helper) when options.owner is falsy. Claiming means assigning an item to an owner, so an owner is mandatory at the CLI boundary even though the underlying helper accepts whatever it is given. This keeps the user-facing error message flag-specific.
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 01e15490f0)
Solutions
- Pass --owner: `node scripts/work-items.js claim <id> --owner alice`.
- For an agent claim, combine with --as agent: `claim <id> --owner bot --as agent`.
- If scripting, set options.owner before calling claimWorkItemCli.
Example fix
// before node scripts/work-items.js claim refactor-state-store // after node scripts/work-items.js claim refactor-state-store --owner alice
Defensive patterns
Strategy: validation
Validate before calling
function ensureClaimOwner(options) {
if (!options || !options.owner) {
throw new Error('claim requires --owner <name>');
}
return options;
}
// call before claimWorkItemCli(store, ensureClaimOwner(options)) Type guard
function hasClaimOwner(options) {
return Boolean(options && typeof options.owner === 'string' && options.owner.trim());
} Prevention
- Treat --owner as required for the claim command in all scripts.
- Derive owner from a trusted source (CI user, session id) and assert it is non-empty before claiming.
- Do not assume the owner is inferred from git or session; it must be passed.
When it happens
Trigger: Running `node scripts/work-items.js claim <id>` (or `claim` with no id) without --owner <name>. Any claim invocation missing the --owner flag hits this before the shared helper is called.
Common situations: Assuming the owner is inferred from the current git user or session (it is not); forgetting the flag in an automation script; passing the owner as a positional rather than via --owner.
Related errors
- Missing issue number.
- Missing --repo <owner/repo>.
- Missing GitHub repo. Pass --repo <owner/repo>.
- Missing work item id. Pass <id> or --id <id>.
- Missing --title for a new work item.
AI-assisted analysis of affaan-m/ECC@01e15490f0 (2026-08-13).
Data as JSON: /api/errors/45c0963bc4a0641e.
Report an issue: GitHub.