Repository navigation
Description
Target: v6.
Target branch:
v6. Open the PR with--base v6. Citations arepath:lineonv6@e912f7c(release 6.52.4), plus the function name, so the pointers still work after the lines drift.
Executive summary
The hive works out which AI model wrote a PR by reading the attribution trailer in the PR body (— hive: agent=… backend=… model=…). The parser accepts the trailer only when it is the last non-empty line of the body. Any line after it makes the PR disappear from PRs by model, Most effective models, and the rework and cost figures built on them.
That happens a lot, and the hive causes some of it itself. On projectbluefin, 112 of 707 trailer-carrying PRs opened since 2026-10-20 (16%) are dropped this way. The most common lines after the trailer are Refs #N, Closes #N, the Claude Code 🤖 Generated with … line, and the hive's own <!-- hive:issue-link-fixed --> marker.
The fix: find the trailer even when known footer lines follow it, and make the hive stop appending its own marker after the trailer.
Problem
ParseAttributionTrailer walks the body from the end, skips blank lines, and looks only at the first non-blank line it meets. If that line does not start with a trailer prefix, it returns "no trailer". A PR body with any line after the trailer is therefore unattributed, even though the trailer is right there.
The parser does strip the identity footer first (--- + 🐝 **Hive Agent**: …), so that footer is not the problem. Everything else after the trailer is.
Evidence
Scan of every PR in the 20 projectbluefin repos created since 2026-10-20, reading the last — hive: line in each body and comparing it with the parser's rule. Of 707 PRs with a trailer, 112 have a non-blank line after it (identity footer excluded). What that line was:
| Line after the trailer | PRs |
|---|---|
Refs #N (with or without a note) |
46 |
<!-- hive:issue-link-fixed --> |
22 |
Closes #N |
14 |
🤖 Generated with [Claude Code]… |
11 |
Fixes #N |
2 |
| Free text (agent prose, URLs) | ~17 |
By model: Claude Opus 5.5 loses 47 PRs, GPT-6.1 Sol 31, Ornith 15, GPT-6.1 Terra 7.
Concrete examples (all recent enough that nothing else hides them):
- fix(parity): resolve the remaining dev-tools packages projectbluefin/utah-packages#949 (merged): the trailer
— hive: agent=scanner backend=copilot model=claude-opus-5.5 …is followed by<!-- hive:issue-link-fixed -->, which the hive appended itself. - fix(ydotool): make the input automation tool build again with the newer build tools projectbluefin/utah-packages#1014 (merged): the trailer is followed by
Closes #1000, then the identity footer. - fix(renovate): keep the dependency-update bot on the same installer version as our checks projectbluefin/website#1040: the trailer is followed by
🤖 Generated with [Claude Code](https://claude.com/claude-code), then the identity footer.
Root cause
- Parser:
src/pkg/github/attribution.go:468ParseAttributionTrailer. The loop at:473-482breaks on the first non-blank line from the end, whether or not it is a trailer. - The hive breaks its own trailers:
src/pkg/github/pr_issue_link.go:398rewriteRefsIssueLinkToClosingappends"\n\n" + issueLinkFixedMarkerat the very end of the body, after the trailer. Every PR this repair touches becomes unattributed.
Wanted behavior
- A PR whose trailer is followed only by footer lines is still attributed. Footer lines are: closing or reference keywords (
Refs,Ref,Closes,Fixes,Resolves,Part of, any case, with#Norowner/repo#N, optional note text after); HTML comments (<!-- … -->); and the Claude Code🤖 Generated withline. rewriteRefsIssueLinkToClosingputs its marker above the attribution trailer when there is one, so the trailer stays at the end.- A trailer quoted in the middle of prose is still not taken as the PR's own attribution. That is why the parser is strict today; keep it strict for anything that is not a known footer line.
Acceptance criteria
-
ParseAttributionTrailerreturns the trailer's metadata when the trailer is followed by any mix of the footer lines listed above, and by the identity footer. - It still returns
falsewhen the trailer is followed by an ordinary prose line or a code block. - When a body has two trailer lines, the last one wins (same as today).
-
rewriteRefsIssueLinkToClosingoutput keeps the trailer as the last line before any identity footer, with the marker placed above it. A body with no trailer keeps today's output. - Existing attribution tests pass unchanged.
Test plan
- Add cases to
src/pkg/github/attribution_test.go(or a newattribution_footer_lines_test.go): one per footer type above, a mixed tail, the identity footer after a footer line, prose after the trailer (stays unattributed), and two trailers. - Add cases to
src/pkg/github/pr_issue_link_test.goforrewriteRefsIssueLinkToClosingwith and without a trailer. - Run
go test ./src/pkg/github/...in CI. Per AGENTS.md, do not run localgo test/go build;gofmt -lonly.
Out of scope
- The 14-day closed-PR lookback that also hides PRs from the same card. That is a separate issue (linked below).
- Changing the trailer format, or rewriting existing PR bodies on GitHub. Fixing the parser re-attributes old PRs on the next enumeration.
Related: #18713 / #18739 (coverage disclosure on the same card).
Sibling issue (closed-PR lookback): #19365
Activity
hivecommons-hive commentedon Nov 20, 2026
🔒 Claimed by @kellyaa (contributor on hive hosted-available-oke-11-placeholder-r05x). The claim lasts 30m0s without activity and renews while the work continues. Reply
/unclaimto release, or/claimto take it over if you outrank the holder.Claim history
kellyaa(contributor on hive hosted-available-oke-11-placeholder-r05x)Danathar commentedon Nov 20, 2026
Fixed by #19366 (#19366), merged into v6 at c06e742. The PR body lacked a closing keyword, so closing by hand. #19367 (extra regression cases on top of it) stays open on its own.