ruvnet/ruflo · error

Issue not found

Error message

Issue not found: ${input.issueId}

What it means

Thrown by the claim-issue MCP tool handler in @claude-flow/claims when issueStore.get(input.issueId) returns nothing, i.e. the issue id is unknown to the in-process store used by the 'Simple implementation' path (taken when no claimsService is present in the tool context). The store is an in-memory Map, so issues must have been registered in the same process before claiming.

Solutions

  1. Create/register the issue first via the issue creation tool in the same process, then claim it
  2. Verify the id with the list-issues/issue_list_available tool before claiming
  3. If you need cross-process persistence, run with a claimsService context backed by the claim repository instead of the in-memory fallback

Example fix

// before
await claimTool({ issueId: 'issue-999', claimantId: 'agent-1', claimantType: 'agent' });

// after
await createIssueTool({ id: 'issue-999', title: 'Fix login' });
await claimTool({ issueId: 'issue-999', claimantId: 'agent-1', claimantType: 'agent' });
Defensive patterns

Strategy: try-catch

Validate before calling

const issues = await listIssuesTool({});
if (!issues.issues.some(i => i.id === issueId)) {
  await createIssueTool({ id: issueId, title });
}
await claimTool({ issueId, claimantId, claimantType });

Try / catch

try { await claimTool(input); } catch (e) { if (e instanceof Error && /^Issue not found:/.test(e.message)) { await createIssueTool({ id: input.issueId, title: 'auto-created' }); return claimTool(input); } throw e; }

Prevention

When it happens

Trigger: Calling the claim tool with an issueId that was never created via the issue-creation tool; running the MCP server in a mode where the issue store is empty (fresh process, no persistence); a typo'd or truncated id; referencing issues from a previous server run after a restart of the in-memory store.

Common situations: Mixing ids from an external issue tracker with the local issueStore; server restarts wiping in-memory state while clients keep old ids; race where one worker creates issues in a different process than the one claiming.

Understand the failure class

Background: "Not found" and "does not exist" errors: why "Task not found", "No such folder", and "Can't find" fire when a lookup comes back empty — this error's family across 14 libraries.

Related errors


AI-assisted analysis of ruvnet/ruflo@fa13ee4ad6 (2026-08-18). Data as JSON: /api/errors/b92e0ed7669f526c. Report an issue: GitHub.

Appendix: source

Thrown at v3/@claude-flow/claims/src/api/mcp-tools.ts:499

  // Try to use claims service if available
  if (context?.claimsService) {
    const claim = await context.claimsService.claimIssue(input);
    return {
      claimId: claim.id,
      issueId: claim.issueId,
      claimantId: claim.claimantId,
      claimantType: claim.claimantType,
      status: claim.status,
      claimedAt: claim.claimedAt,
      expiresAt: claim.expiresAt,
    };
  }

  // Simple implementation
  const issue = issueStore.get(input.issueId);
  if (!issue) {
    throw new Error(`Issue not found: ${input.issueId}`);
  }

  if (issue.claimedBy) {
    throw new Error(`Issue ${input.issueId} is already claimed by ${issue.claimedBy}`);
  }

  const claimId = generateSecureId('claim');
  const claimedAt = new Date().toISOString();
  const expiresAt = input.expiresInMs
    ? new Date(Date.now() + input.expiresInMs).toISOString()
    : undefined;

  const claim: Claim = {
    id: claimId,
    issueId: input.issueId,
    claimantType: input.claimantType,
    claimantId: input.claimantId,
    status: 'active',

View on GitHub (pinned to fa13ee4ad6)