Skip to content

feat(watch-pr): read review-bot detection from review-bots.json - #1157

Open
CRGDan wants to merge 1 commit into
cursor:mainfrom
CRGDan:feat/watch-pr-review-bot-config
Open

CRGDan wants to merge 1 commit into
cursor:mainfrom
CRGDan:feat/watch-pr-review-bot-config

Conversation

@CRGDan

@CRGDan CRGDan commented Nov 2, 2026

Copy link
Copy Markdown

Tracking: CRGDan/pstack-t3#5

Why

watch-pr recognises only Cursor Bugbot. A team that also runs another review bot gets no pass count for that bot's threads, and the watcher can report READY while that bot's check is still running. This PR moves the detection rules into a config file that ships with Bugbot as its only entry, so another bot becomes a config change instead of a code patch. It is the first, behaviour-preserving step of #592, cut down to that step.

What changed

  • review-bots.json holds the author, body-token, pass-marker and running-check rules that github.ts and policy.ts hardcoded. --review-bots <path> loads another file. A bad file is a usage error before any GitHub call.
  • Each thread reports reviewBot (the bot id, or null) and reviewBotPasses (that bot's pass count) in place of isBugbot and bugbotReviewPasses. Babysit step 8 names the new field.
  • The Claude Code harness tree is regenerated.

Scope

  • The shipped config reproduces today's Bugbot rules exactly. It adds no other bot.
  • It leaves out a pass key taken from the reviewed commit. Bots that put no run ID in their comments (CodeRabbit, the Codex connector) need it. That is a follow-up.

Blast Radius

A reader of the JSON verdict that uses isBugbot or bugbotReviewPasses must switch to the new fields. Nothing in pstack reads them after this PR. A thread opened by a person now reports 0 passes, where it repeated Bugbot's count before.

Verification

  • bun test watch-pr passes 73 tests, up from 54. The two existing pass-count tests changed only their field names. bun run typecheck and the four validate-plugins steps pass locally.
  • Main and this branch classify the 554 review threads on 279 cursor/plugins PRs, 541 of them from Bugbot, with no difference in bot or pass count.
  • watch-pr --status-only on 5 live PRs, 30 runs per side interleaved with main: median 2425 ms → 2426 ms. GitHub API round trips bound the run, and module load is 30 ms on both sides.

🤖 Generated with Claude Code

watch-pr recognised only Cursor Bugbot, through author names, body
tokens, run-ID patterns and check names written into github.ts and
policy.ts. Those rules now live in review-bots.json beside the script,
and --review-bots <path> loads another file. The shipped file holds the
Bugbot entry alone, so the default behaviour does not change.

Each thread reports reviewBot (the bot id, or null) and reviewBotPasses
(that bot's pass count) in place of isBugbot and bugbotReviewPasses.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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