{"record":{"id":"8560bfbb75284df4","repo":"ruvnet/ruflo","slug":"handoff-not-addressed-to-this-formatclaimant-cla","errorCode":null,"errorMessage":"Handoff not addressed to ${this.formatClaimant(claimant)}","messagePattern":"Handoff not addressed to (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"v3/@claude-flow/cli/src/services/claim-service.ts","lineNumber":362,"sourceCode":"    await this.saveClaims();\n\n    this.emitEvent({\n      type: 'issue:handoff:requested',\n      timestamp: new Date(),\n      issueId,\n      claimant: from,\n      data: { to, reason },\n    });\n  }\n\n  async acceptHandoff(issueId: string, claimant: Claimant): Promise<void> {\n    const claim = this.claims.get(issueId);\n    if (!claim || claim.status !== 'handoff-pending') {\n      throw new Error(`No pending handoff for issue ${issueId}`);\n    }\n\n    if (!claim.handoffTo || !this.isSameClaimant(claim.handoffTo, claimant)) {\n      throw new Error(`Handoff not addressed to ${this.formatClaimant(claimant)}`);\n    }\n\n    const previousClaimant = claim.claimant;\n    claim.claimant = claimant;\n    claim.status = 'active';\n    claim.statusChangedAt = new Date();\n    delete claim.handoffTo;\n    delete claim.handoffReason;\n    await this.saveClaims();\n\n    this.emitEvent({\n      type: 'issue:handoff:accepted',\n      timestamp: new Date(),\n      issueId,\n      claimant,\n      previousClaimant,\n    });\n  }","sourceCodeStart":344,"sourceCodeEnd":380,"githubUrl":"https://github.com/ruvnet/ruflo/blob/6b01dc5a687b26b3e218f796de45ec51f8fa9e8c/v3/@claude-flow/cli/src/services/claim-service.ts#L344-L380","documentation":"Second guard in acceptHandoff(): a handoff is pending, but claim.handoffTo is not isSameClaimant to the caller. This stops a claimant other than the intended recipient from accepting the handoff. The message names the caller's claimant via formatClaimant.","triggerScenarios":"Agent C trying to accept a handoff addressed to agent B; a human trying to accept an agent-targeted handoff; using a claimant whose agentId differs from the handoffTo by a typo or stale id.","commonSituations":"Broadcast handoff offers where multiple agents race to accept; mismatched identity between requestHandoff `to` and the accepter; tests using placeholder claimants.","solutions":["Ensure the accepter's claimant exactly matches the `to` passed to requestHandoff.","If the intended recipient is unavailable, reject the handoff first, then re-request to a new recipient.","Validate recipient identity before issuing the handoff request."],"exampleFix":"// before: wrong recipient accepts\nawait claims.acceptHandoff(issueId, agentC); // addressed to agentB -> throws\n\n// after: only the addressed recipient accepts\nif (isSameClaimant(me, claim.handoffTo)) {\n  await claims.acceptHandoff(issueId, me);\n} else {\n  // not ours to accept; optionally reject with reason\n}","handlingStrategy":"validation","validationCode":"function canAcceptHandoff(claims, issueId, claimant) {\n  const c = claims.list?.().find(x => x.issueId === issueId);\n  return !!c && c.status === 'handoff-pending' && !!c.handoffTo && isSameClaimant(c.handoffTo, claimant);\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Ensure the accepter matches the `to` passed to requestHandoff exactly.","If the recipient is unavailable, reject first then re-request to a new recipient.","Validate recipient identity before issuing the handoff request."],"tags":["claim-service","handoff","ownership","authorization"],"backgroundTag":null,"analyzedSha":"6b01dc5a687b26b3e218f796de45ec51f8fa9e8c","analyzedAt":"2026-08-12T13:20:50.148Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}