{"record":{"id":"b92e0ed7669f526c","repo":"ruvnet/ruflo","slug":"issue-not-found-input-issueid","errorCode":null,"errorMessage":"Issue not found: ${input.issueId}","messagePattern":"Issue not found: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"v3/@claude-flow/claims/src/api/mcp-tools.ts","lineNumber":499,"sourceCode":"\n  // Try to use claims service if available\n  if (context?.claimsService) {\n    const claim = await context.claimsService.claimIssue(input);\n    return {\n      claimId: claim.id,\n      issueId: claim.issueId,\n      claimantId: claim.claimantId,\n      claimantType: claim.claimantType,\n      status: claim.status,\n      claimedAt: claim.claimedAt,\n      expiresAt: claim.expiresAt,\n    };\n  }\n\n  // Simple implementation\n  const issue = issueStore.get(input.issueId);\n  if (!issue) {\n    throw new Error(`Issue not found: ${input.issueId}`);\n  }\n\n  if (issue.claimedBy) {\n    throw new Error(`Issue ${input.issueId} is already claimed by ${issue.claimedBy}`);\n  }\n\n  const claimId = generateSecureId('claim');\n  const claimedAt = new Date().toISOString();\n  const expiresAt = input.expiresInMs\n    ? new Date(Date.now() + input.expiresInMs).toISOString()\n    : undefined;\n\n  const claim: Claim = {\n    id: claimId,\n    issueId: input.issueId,\n    claimantType: input.claimantType,\n    claimantId: input.claimantId,\n    status: 'active',","sourceCodeStart":481,"sourceCodeEnd":517,"githubUrl":"https://github.com/ruvnet/ruflo/blob/fa13ee4ad60ac2090b1480656eb233521790d640/v3/@claude-flow/claims/src/api/mcp-tools.ts#L481-L517","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Create/register the issue first via the issue creation tool in the same process, then claim it","Verify the id with the list-issues/issue_list_available tool before claiming","If you need cross-process persistence, run with a claimsService context backed by the claim repository instead of the in-memory fallback"],"exampleFix":"// before\nawait claimTool({ issueId: 'issue-999', claimantId: 'agent-1', claimantType: 'agent' });\n\n// after\nawait createIssueTool({ id: 'issue-999', title: 'Fix login' });\nawait claimTool({ issueId: 'issue-999', claimantId: 'agent-1', claimantType: 'agent' });","handlingStrategy":"try-catch","validationCode":"const issues = await listIssuesTool({});\nif (!issues.issues.some(i => i.id === issueId)) {\n  await createIssueTool({ id: issueId, title });\n}\nawait claimTool({ issueId, claimantId, claimantType });","typeGuard":null,"tryCatchPattern":"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; }","preventionTips":["Create and claim issues in the same process/session against the in-memory store","Derive issueIds from the creation tool's response instead of hand-typing them"],"tags":["claims","mcp-tools","issue-not-found","in-memory-state"],"backgroundTag":"entity-not-found","analyzedSha":"fa13ee4ad60ac2090b1480656eb233521790d640","analyzedAt":"2026-08-18T21:34:22.708Z","contentChangedAt":"2026-08-18T21:34:22.708Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}