ruvnet/ruflo · error · Error
Invalid target format: ${target}. Use agent:<id> or human:<i
Error message
Invalid target format: ${target}. Use agent:<id> or human:<id> What it means
Thrown by parseTarget() in the claims CLI when the target string does not split into '<type>:<id>' with type being exactly 'agent' or 'human'. The split is naive (target.split(':')) so any value without a colon, with an empty id, or with a different prefix trips it.
Source
Thrown at v3/@claude-flow/claims/src/api/cli-commands.ts:174
}
const hours = Math.floor(diffMs / (1000 * 60 * 60));
const minutes = Math.floor((diffMs % (1000 * 60 * 60)) / (1000 * 60));
if (hours < 1) {
return output.warning(`${minutes}m`);
} else if (hours < 4) {
return output.warning(`${hours}h ${minutes}m`);
}
return output.dim(`${hours}h ${minutes}m`);
}
function parseTarget(target: string): { id: string; type: ClaimantType } {
// Format: agent:coder-1 or human:alice
const [type, id] = target.split(':');
if (!type || !id || (type !== 'agent' && type !== 'human')) {
throw new Error(`Invalid target format: ${target}. Use agent:<id> or human:<id>`);
}
return { id, type: type as ClaimantType };
}
// ============================================
// List Subcommand
// ============================================
const listCommand: Command = {
name: 'list',
aliases: ['ls'],
description: 'List issues',
options: [
{
name: 'available',
short: 'a',
description: 'Show only unclaimed issues',
type: 'boolean',View on GitHub (pinned to 6b01dc5a68)
Solutions
- Format the target as 'agent:<id>' or 'human:<id>' exactly.
- Add input validation/suggestions in the CLI wrapper before calling parseTarget.
- If you need a new claimant type, extend parseTarget's allowed set rather than passing an unsupported prefix.
Example fix
// before
const t = parseTarget('coder-1'); // throws 65
// after
const t = parseTarget('agent:coder-1'); Defensive patterns
Strategy: validation
Validate before calling
function isValidTarget(t) {
const [type, id] = String(t).split(':');
return (type === 'agent' || type === 'human') && !!id;
} Type guard
function isValidTarget(t) {
const [type, id] = String(t).split(':');
return (type === 'agent' || type === 'human') && !!id;
} Try / catch
null
Prevention
- Always format targets as agent:<id> or human:<id>.
- Validate at the CLI argument parser before reaching parseTarget.
When it happens
Trigger: Passing a target like 'coder-1' (no prefix), 'user:alice' (wrong type), 'agent:' (empty id), ':alice' (empty type), or 'agent:coder:1' (the split takes only the first colon and discards the rest as id, but extra colons leave id containing colons which is allowed — the real failure is type/id emptiness).
Common situations: User typos at the CLI; copy-pasting an issue ID instead of a target; using a custom claimant type not in {agent, human}.
Related errors
- Invalid completion type
- browser/eval: script must not be empty
- Issue not found: ${input.issueId}
- Issue ${input.issueId} is already claimed by ${issue.claimed
- Issue ${input.issueId} is not claimed by ${input.claimantId}
AI-assisted analysis of ruvnet/ruflo@6b01dc5a68 (2026-08-12).
Data as JSON: /api/errors/464786072eb2f936.
Report an issue: GitHub.