Skip to content

fix(release): count Copilot inline comments by their own login#180

Merged
jbaruch merged 2 commits into
mainfrom
fix/copilot-comment-login
Jul 17, 2026
Merged

fix(release): count Copilot inline comments by their own login#180
jbaruch merged 2 commits into
mainfrom
fix/copilot-comment-login

Conversation

@jbaruch

@jbaruch jbaruch commented Jul 16, 2026

Copy link
Copy Markdown
Owner

Author-Model: claude-opus-4-8

Summary

poll-pr-reviews.sh has been reporting zero Copilot inline comments on every PR, always. Not a race, not intermittent — structural.

Copilot uses two different logins on the same PR:

surface login
review copilot-pull-request-reviewer[bot]
inline comment Copilot

toplevel_comments_by matched comments against the review login, which never matches a comment, so inline_comments.copilot was a constant 0.

Why that matters: SKILL.md Step 7 gates the merge on "every inline comment from Step 5's inline_comments count has a Fixed in <sha> or Declining — <reason> reply." A count that is always zero satisfies that condition vacuously. Every Copilot inline finding since this counter was written has been invisible to the release workflow and mergeable unanswered.

Scope: gh-aw is unaffected — github-actions[bot] authors both its reviews and its comments. dismiss-stale-reviews.sh is unaffected — it matches on reviews, where the review login is correct.

Found while shipping #178. Copilot's review body said "generated 1 comment", the watcher reported inline_comments.copilot: 0, and the comment turned out to be a correct finding about that PR's own diff. Worth noting this fix is a precondition for #178 specifically: that PR adds an always-on rule telling agents to merge on a green gate without asking, which removes the accidental human backstop — someone eyeballing the PR page — that has been quietly compensating for this bug. Autonomy is only as good as the gate's fidelity, so the gate gets fixed first.

Fix

  • toplevel_comments_by is variadic on login and matches a set per reviewer. A comment carries exactly one author, so listing both logins cannot double-count.
  • Logins are named script-owned constants (GH_AW_REVIEW_LOGIN, COPILOT_REVIEW_LOGIN, GH_AW_COMMENT_LOGINS, COPILOT_COMMENT_LOGINS) with the surface/login table documented at the top of the script, per rules/script-as-black-box.md.

Test plan

  • t_main_counts_copilot_comments_in_snapshot — end-to-end through main(), the path the gate reads. Fails against the pre-fix script with expected '2|1', got '2|0'; that 0 is the bug.
  • t_toplevel_comments_by_matches_either_copilot_login — guards against a fix that swaps the login instead of matching both.
  • t_toplevel_comments_by_excludes_replies_and_other_logins — replies and human comments stay excluded.
  • Full suite: 15 passed, 0 failed. bash -n clean, shellcheck clean.
  • Live check against feat(rules): make green-gate shipping actions autonomous #178: inline_comments.copilot now 1, was 0.
  • Paired cross-family policy review + Copilot

🤖 Generated with Claude Code

https://claude.ai/code/session_01JgdWmv7KBj91nxbVjMsj7X

Copilot AI review requested due to automatic review settings July 16, 2026 17:45

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Fixes the release workflow’s PR snapshot so Copilot inline comments are correctly counted (and therefore correctly gated) even though Copilot uses a different login for inline comments than for reviews.

Changes:

  • Teach toplevel_comments_by to accept multiple logins and update main() to count Copilot inline comments using both known Copilot author identities.
  • Add targeted regression tests covering either-login matching, reply/foreign-login exclusion, and an end-to-end main() snapshot.
  • Document the behavior/fix in CHANGELOG.md.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
skills/release/poll-pr-reviews.sh Counts inline comments by a set of logins per reviewer and introduces explicit bot-login constants.
skills/release/tests/test_poll_pr_reviews.sh Adds regression coverage to ensure Copilot inline comments are actually counted and don’t bleed into gh-aw counts.
CHANGELOG.md Adds an entry describing the bug and the fix.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread CHANGELOG.md Outdated

### Skills

- **`release`: `poll-pr-reviews.sh` counted zero Copilot inline comments on every PR** — Copilot authors its review as `copilot-pull-request-reviewer[bot]` but its inline comments as `Copilot`; `toplevel_comments_by` matched comments against the review login, so `inline_comments.copilot` was a constant `0`. Step 7's merge gate reads that count for its "every inline comment has a `Fixed in <sha>` or `Declining — <reason>` reply" condition, which a zero count satisfies vacuously — every Copilot inline finding since the counter was written was invisible to the release workflow and mergeable unanswered. Comment counting now matches a set of logins per reviewer (`GH_AW_COMMENT_LOGINS`, `COPILOT_COMMENT_LOGINS` at the top of the script) rather than the single review login; a comment carries one author, so listing both cannot double-count. gh-aw was unaffected (`github-actions[bot]` authors both its reviews and comments), as was `dismiss-stale-reviews.sh` (it matches reviews, where the review login is correct). Found while shipping PR #178: Copilot's body said "generated 1 comment", the watcher reported 0, and the real comment turned out to be a correct finding about the PR's own diff. Regression covered end-to-end through `main()` — the path the gate reads — plus unit coverage for either-login matching and reply/foreign-login exclusion.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in e6ac9ff — tightened to three sentences, keeping the two-login fact and the vacuous-gate consequence and pointing at this PR body for the rest.

Worth recording that this comment is itself the fix working: the watcher on this PR ran the patched script and reported inline_comments.copilot: 1. On the unpatched script it reads 0, the Step 7 reply gate is satisfied vacuously, and your finding merges unanswered — which is exactly what has been happening to every Copilot inline comment until now.

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Policy loaded: 23 rule files from rules/ (PR head).
All rules pass — no violations found.

Checked the changed release polling script, its regression tests, and the changelog entry against the loaded policy set. The Copilot comment-login fix is covered through both toplevel_comments_by and the main() snapshot path, and the changed paths stay within the release skill’s scripting/testing expectations.

Generated by PR Policy Review (OpenAI) for #180 · 37.2 AIC · ⌖ 5.18 AIC · ⊞ 14.6K

jbaruch added a commit that referenced this pull request Jul 16, 2026
Per rules/context-artifacts.md CHANGELOG Hygiene — an entry can be one
or two sentences when the broader context lives in the PR body. Keep the
two-login fact and the vacuous-gate consequence; point at #180 for the rest.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JgdWmv7KBj91nxbVjMsj7X
@jbaruch
jbaruch requested a review from Copilot July 16, 2026 17:52

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated no new comments.

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Policy loaded: 23 rule files from rules/ (PR head).
All rules pass — no violations found.

Reviewed the changed release polling script, its regression tests, and the changelog entry against the loaded rules and the governing release skill. No inline findings.

Generated by PR Policy Review (OpenAI) for #180 · 38.2 AIC · ⌖ 3.4 AIC · ⊞ 15.5K

jbaruch and others added 2 commits July 16, 2026 21:00
Copilot authors its review as `copilot-pull-request-reviewer[bot]` but
its inline comments as `Copilot`. toplevel_comments_by matched comments
against the review login, so inline_comments.copilot was a constant 0
on every PR.

Step 7's merge gate reads that count to require a reply on every inline
comment. A count that is always zero satisfies it vacuously, so every
Copilot inline finding was invisible to the release workflow and
mergeable unanswered.

Match a set of logins per reviewer instead of the single review login.
A comment carries one author, so listing both cannot double-count.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JgdWmv7KBj91nxbVjMsj7X
Per rules/context-artifacts.md CHANGELOG Hygiene — an entry can be one
or two sentences when the broader context lives in the PR body. Keep the
two-login fact and the vacuous-gate consequence; point at #180 for the rest.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JgdWmv7KBj91nxbVjMsj7X
@jbaruch
jbaruch force-pushed the fix/copilot-comment-login branch from e6ac9ff to b7ad201 Compare July 17, 2026 02:00

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Policy loaded: 23 rule files from rules/ (PR head).

All rules pass — no violations found.

Reviewed the changed allowlist: CHANGELOG.md, skills/release/poll-pr-reviews.sh, and skills/release/tests/test_poll_pr_reviews.sh. The release skill's governing SKILL.md was also loaded for the changed script path. No inline findings.

Generated by PR Policy Review (OpenAI) for #180 · 31.6 AIC · ⌖ 3.94 AIC · ⊞ 14.6K

@jbaruch
jbaruch merged commit d13d5c0 into main Jul 17, 2026
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants