{"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":null,"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/fa13ee4ad60ac2090b1480656eb233521790d640/v3/@claude-flow/cli/src/services/claim-service.ts#L344-L380","documentation":"ClaimService.acceptHandoff(issueId, claimant) found a 'handoff-pending' claim, but the claimant argument does not match the handoffTo target recorded by requestHandoff (isSameClaimant fails). Handoffs are addressed to a specific receiving agent, so only that agent can accept. The error names the claimant that tried to accept.","triggerScenarios":"A different worker than the designated handoffTo calls acceptHandoff — e.g. the wrong agent picked up the notification, agent identity changed between request and accept, or accept code passes a default/service account Claimant instead of the intended recipient.","commonSituations":"Multiple workers subscribing to a shared handoff queue, restarted agents with regenerated ids, tests reusing one Claimant for both sides of the handoff.","solutions":["Route the accept call to exactly the agent named in handoffTo (read it via getIssueStatus(issueId).handoffTo)","If the intended recipient changed, the owner must call requestHandoff again with the new target; the old pending handoff can be cleared via rejectHandoff by the current target","Keep agent identity stable across restarts so handoffTo comparisons succeed"],"exampleFix":"// before\nawait claims.acceptHandoff(issueId, anyWorker); // anyWorker !== handoffTo -> throws\n\n// after\nconst claim = await claims.getIssueStatus(issueId);\nif (claim?.status === 'handoff-pending' && isSame(claim.handoffTo, me)) {\n  await claims.acceptHandoff(issueId, me);\n}","handlingStrategy":"try-catch","validationCode":"const claim = await claims.getIssueStatus(issueId);\nconst addressedToMe = claim?.status === 'handoff-pending' && !!claim.handoffTo && isSameClaimant(claim.handoffTo, me);\nif (addressedToMe) await claims.acceptHandoff(issueId, me);","typeGuard":null,"tryCatchPattern":"try {\n  await claims.acceptHandoff(issueId, me);\n} catch (e) {\n  if (e instanceof Error && e.message.startsWith('Handoff not addressed to')) {\n    // wrong recipient: ignore — the addressee will accept; or ask the owner to re-request to me\n  } else throw e;\n}","preventionTips":["Deliver handoff notifications only to the agent recorded in handoffTo","Compare against claim.handoffTo (from getIssueStatus) before accepting","Stabilize agent ids across restarts so the addressee identity still matches later"],"tags":["claim-service","handoff","ownership","authorization"],"backgroundTag":"ownership-mismatch","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"}