{"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":"Error","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/6b01dc5a687b26b3e218f796de45ec51f8fa9e8c/v3/@claude-flow/claims/src/api/mcp-tools.ts#L481-L517","documentation":"Thrown by the simple (non-service) claimIssue handler in mcp-tools.ts when issueStore.get(input.issueId) returns undefined. The service-backed path (context.claimsService) is tried first; this only fires in the in-memory fallback path that has no persistence. The check precedes the already-claimed check.","triggerScenarios":"Calling claimIssue with an issueId that was never registered in the in-memory issueStore, or an ID from a different process/instance where the Map is empty.","commonSituations":"Using the tool without wiring up an issue store; passing a typo'd or stale ID; running against a fresh process that lost prior in-memory state; mixing ID formats (e.g., 'ISSUE-1' vs 'issue-1').","solutions":["Ensure the issue was created via the matching createIssue/registerIssue tool in the same process.","Pass a configured context.claimsService backed by a real repository so the service path handles lookup with proper persistence.","List available issues first to confirm the exact ID."],"exampleFix":"// before\nawait claimIssue.handler({ issueId: 'ISSUE-42', claimantId: 'alice', claimantType: 'human' });\n// throws 66 if 'ISSUE-42' not in issueStore\n\n// after — verify existence first\nconst list = await listIssues.handler({});\nconst exists = list.issues.some(i => i.id === 'ISSUE-42');\nif (exists) await claimIssue.handler({ issueId: 'ISSUE-42', claimantId: 'alice', claimantType: 'human' });","handlingStrategy":"validation","validationCode":"function issueExists(store, id) { return store.has(id); }\nif (!issueExists(issueStore, input.issueId)) throw new Error(`unknown issue ${input.issueId}`);","typeGuard":"null","tryCatchPattern":"try { await claimIssue.handler(input, ctx); } catch (e) { if (/Issue not found/.test(e.message)) { /* create or skip */ } else throw e; }","preventionTips":["Use the service-backed path (context.claimsService) with a persistent repository instead of the in-memory fallback.","Create issues via the matching tool before claiming them in the same process."],"tags":["claims","mcp","in-memory","missing-record","typescript"],"backgroundTag":null,"analyzedSha":"6b01dc5a687b26b3e218f796de45ec51f8fa9e8c","analyzedAt":"2026-08-12T13:20:50.148Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}