Skip to content

review: recording a head verdict does not wake dispatch, so reviewers idle until the next governor cycle #14705

Closed

Description

@gregoryhunt

Summary

Review dispatch is planned only on a governor eval cycle, and recording a head verdict does not start one. A review head's turn takes 1–2 minutes, but the next kick waits for the next cycle. On a hive with healthy webhooks that cycle comes from an unrelated GitHub event (check_run, push, comment) or from governor.eval_interval_webhook_s, which defaults to 900s. When the repo is quiet, every reviewer sits idle for up to 15 minutes between kicks.

With review_heads, a PR needs every head × every perspective, plus the decision kick. With 2 heads and 5 perspectives that is 10 head kicks, so a PR goes through several idle gaps before it reaches its decision. The swarm's throughput ends up bounded by the governor clock, not by the reviewers.

Observed (standalone hive, v5 @ a474553; review_heads sonnet×2 + sol×3, 5 perspectives, max_parallel_reviews: 2)

Timeline from the hive log (times are hive-local):

16:31:02–16:31:59  six head verdicts recorded; all five reviewers' turns end
16:37:09           review swarm dispatch planned            <- next eval cycle, 5 min idle
16:38:54–16:41:10  verdicts recorded; all turns end by 16:41:10
16:52:08           review swarm dispatch planned            <- 11 min idle (no webhook in between)

Head turns in the same window took 46–125 s (kick turn ended … seconds_since_kick). No PR reached its decision kick in the 40 minutes after a perspective change queued about 10 PRs for re-review. Lowering eval_interval_webhook_s from 900 to 120 is the operator workaround; it buys throughput by making every governor cycle more frequent.

Where

  • src/cmd/hive/review_event_dispatch.go: wakeForReviewEvents sends on b.reviewWake, and runLoop (main.go, case <-b.reviewWake:) runs tick(evalSourceCached), logging "review webhook wake: running an early eval cycle from the cached snapshot". Today only the webhook review dispatcher (eventdispatch, ✨ review-pipeline: event-driven review dispatch on PR push / review_requested webhooks with cadence fallback #11091) feeds this wake.
  • src/pkg/github/review_verdict_relay.go: the review-request watcher records a dispatched head's verdict ("verdict recorded" / "verdict recorded without a comment") and confirms its pending entry, but nothing tells the governor that an agent just became free or that a PR may now be ready for its decision kick.

Proposed fix

When the relay records a verdict that confirms a dispatched pending entry (auth.Dispatched), send the same non-blocking wake that wakeForReviewEvents sends, so runLoop runs a cached-snapshot eval. That cycle re-plans with the freed agent. When the last head reports, it dispatches the decision kick, and when the decision is recorded it frees the PR's max_parallel_reviews slot for the next one.

  • Coalescing comes free: reviewWake has a buffer of 1, so a burst of verdicts costs one cycle. governor.webhook_wake_min_gap_s (default 30s) already rate-limits webhook wakes, and the same gap could apply here.
  • Cheap: it is a cached-snapshot cycle, so there is no repo enumeration.
  • Plumbing: the relay lives in pkg/github. A callback such as Client.SetReviewVerdictHook(func()), set in boot to the reviewWake send, keeps the package boundary.

Tests:

  • The relay calls the hook once for a recorded dispatched verdict, and not for a quarantined or advisory one.
  • In runLoop, a verdict wake runs tick(evalSourceCached), and two verdicts inside the min gap run it once.

Why it matters

With the hook, a 10-kick PR finishes in roughly the time its kicks take (about 10–15 minutes here), and eval_interval_webhook_s can stay at its quiet-hive default. Without it, operators have to choose between idle reviewers and a fast governor clock for the whole hive.

Refs #11091 (webhook review dispatch), #13548 (review heads), #13794 (one kick in flight per agent).

🤖 Generated with Claude Code

Activity

  1. hivecommons-hive commented on Oct 27, 2026

    @hivecommons-hive
    Contributor

    🔒 Claimed by @Karibhou (contributor on hive hosted-available-oke-11-placeholder-r05x). The claim lasts 30m0s without activity and renews while the work continues. Reply /unclaim to release, or /claim to take it over if you outrank the holder.

  2. added
    help wantedDenotes an issue that needs help from a contributor. Must meet "help wanted" guidelines.
    on Oct 27, 2026
  3. hivecommons-hive commented on Oct 27, 2026

    @hivecommons-hive
    Contributor

    🔓 Claim by @Karibhou released (lease revoked).

  4. github-actions commented on Oct 27, 2026

    @github-actions
    Contributor

    @gregoryhunt this issue was closed by @hivecommons-hive[bot] as completed.

    If this was closed by a merged PR, the fix only takes effect once it ships in a tagged release and your deployment updates to it — check your running version against the fix before concluding the fix failed.

    If you are still seeing the problem, comment /reopen and it will be reopened for you — you do not need write access. Please add what you are still observing (running version, logs, steps) so it is not closed the same way again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    help wantedDenotes an issue that needs help from a contributor. Must meet "help wanted" guidelines.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions