Repository navigation
✨ review: route bot-authored PR reviews to a cheaper model - #14626
Conversation
PRs opened by Dependabot, Renovate, github-actions and other GitHub Apps are reviewed with review.bot_author_model when set, through the same per-kick model choice the review_models pool uses. The hive's own App login never matches review.bot_authors; a PR touching review.bot_author_full_review_paths (default CI workflows and Dockerfiles) or whose changed files could not be listed keeps the full-strength model. Fixes #14625 Signed-off-by: Andrew Anderson <andy@clubanderson.com>
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
Open PR overlap checkBase branch: Conflicts are checked with every PR merged onto the current tip of
|
|
@clubanderson is auto-promoted for contributor-lane merging on this PR: the last 5 merged PRs by this author in this hive's repositories have no revert or sentinel-alert evidence. CI, reviewer verdict, diff fences, soak, holds and branch protection still apply. |
…gs control exists Signed-off-by: Andrew Anderson <andy@clubanderson.com>
There was a problem hiding this comment.
Read the planner, the wiring in cmd/hive/main.go, and the config helpers. The route's gates are right (unknown files → no downgrade; full-review paths; pool skip/hold preserved). One own-App exclusion gap is real and worth fixing before this lands.
Own-App exclusion only covers one of the two logins (medium). src/pkg/review/bot_route.go:35 excludes exactly one login, ownApp, by EqualFold. Both callers pass cfg.EffectiveAIAuthor() (src/cmd/hive/main.go:10588, and AIAuthor: at the DispatchOptions literal ~:10727). EffectiveAIAuthor() (src/pkg/config/config.go:3847-3855) returns project.ai_author when it is set and only falls back to GitHub.BotLogin() when it is empty. So on a hive that sets project.ai_author to a non-[bot] login while App-authored PRs are on (the default, config.go:3863-3867) — which is exactly what examples/kubestellar/hive-project.yaml:16 does (ai_author: "clubanderson") and what manual-provisioning.md:382 tells operators to do — the App's own <slug>[bot] PRs are not excluded, match the default *[bot] pattern (review_dispatch.go:103), and every hive-authored PR is reviewed on the cheap model. That is the opposite of the file-header rationale ("the hive's own PRs are not dependency bumps") and of review-swarm.md:413, which promises both project.ai_author or the App's [bot] login never match. The wiring test passes only because reviewSwarmConfig sets AIAuthor: "hive-bot" and the test author is also hive-bot. Fix: exclude both cfg.Project.AIAuthor and cfg.GitHub.BotLogin() (e.g. IsBotAuthor(login, patterns, ownApps ...string)), and add a case where ai_author is a person login and the PR author is <slug>[bot].
Verified correct. reviewBotRouteFilesFor (main.go:10586-10597) lists files only when the route is on, the author qualifies, the head is unjudged and nothing is pending, so it is one REST call per head, not per cycle. applyBotAuthorRoute (bot_route.go:141) keeps Skip/RequiresHuman from the independence pool, so the route cannot un-hold a PR. globRegexp handles **/ as optional so .github/workflows/** matches .github/workflows/ci.yml and Dockerfile* matches by basename via the no-slash rule. ReviewPRChangedFiles returns known=false on any error, which the planner reads as no downgrade.
go build not re-run for this head after reading; tests not runnable here (#9845).
— hive: agent=reviewer backend=copilot model=claude-fable-5.1 copilot=1.0.88
|
Thank you for your contribution! Your PR has been merged. We'd love to hear how your experience was: share feedback |
|
merged by Hive trusted-author auto-merge: author @clubanderson holds role owner and GitHub permission admin on repo; CI green at c2d9ca9. |
Fixes #14625
What
A review kick for a PR whose author matches
review.bot_authorsis routed toreview.bot_author_modelthrough the planner's existing per-kick model choice (chooseReviewModel→ReviewModelChoice→ the kick's independent-review instruction), so the reviewer runs the review in a sub-agent on the cheaper model. Not downgraded when: the route is off (default), the author is the hive's own App (project.ai_author/ App[bot]login), the PR touchesreview.bot_author_full_review_paths, or its changed files could not be listed. Pool skip / requires-human decisions are kept.Config (
docs/review-swarm.md)review.bot_author_model:modelorbackend/model, default empty = off. Documented recommendations frompkg/tokens/pricing.go:gemini-flash-3-5,gpt-6-luna; the reviewer engine must support it.review.bot_authors: defaultdependabot[bot],renovate[bot],github-actions[bot],*[bot](leading*= suffix match; hive's own App excluded).review.bot_author_full_review_paths: default.github/workflows/**,Dockerfile*,**/Dockerfile*(**spans directories). Lockfiles deliberately not excepted.Evidence
~/hive-work/reviewer-spend/summary.md, Oct 13-27: other-bot PRs cost $38.61/day across three hives, $30.60/day on Bluefin, all on claude-fable-5.1 ($10/$50).Changes
pkg/review/bot_route.go(new):IsBotAuthor,PathMatchesAny(glob with**),applyBotAuthorRoute;DispatchOptions.BotAuthorRoute,DispatchKick.BotAuthorRouted,PullRequest.ChangedFiles/ChangedFilesKnownpkg/review/dispatch.go: route applied after the pool choice at both the combined and per-perspective kick sitespkg/github/review_bot_route.go(new):ReviewPRChangedFilescmd/hive/main.go:planReviewDispatchWithlists files only for a listed bot's PR with no verdict and no pending review; logs routed kickspkg/config: keys, defaults,BotAuthorModelRefNot covered
The cadence (queue-mode) kick's
review_with=annotation still comes from the agent'sreview_modelspool; review-heads kicks keep their configured head models. Both noted in the docs.