Skip to content

πŸ“Š [v5] PRs by model: list one model's pull requestsΒ #18722

Closed

Description

@Danathar

Target: v5.

Target branch: v5. Open the PR with --base v5. The code paths are the same on v6 (line numbers can differ), and the regular v5 β†’ v6 top-up carries it there, so do not open a second PR for v6. Citations are path:line on v5 @ 8881a15, plus the function name, so the pointers still work after the lines drift.

In the PR body write Refs #<this issue>. Do not use a closing keyword: a PR based on v5 cannot close an issue that way, so a maintainer closes this one after the merge.

Executive summary

The PRs by model card gives totals per model and lists only the ten most-reworked PRs across all models. To check why one model's numbers look the way they do, you need its pull requests themselves:

  • which PRs;
  • merged or closed;
  • how many review rounds and fix attempts each needed.

Nothing on the dashboard or in the API lists them per model. This issue adds an optional model filter to the same endpoint that returns that model's PRs, plus a way to open the list from the card.

Problem

/api/governor/pr-models returns per-model aggregates and a global most_reworked list capped at 10 (api_governor_pr_models.go:279-281). A model's outliers below that cap, or the individual PRs behind a surprising rate, can't be seen. The per-PR data (outcome, rework, backend, agent, URL) is already in the snapshot the endpoint reads.

Evidence

Root cause

  • src/pkg/dashboard/api_governor_pr_models.go:204-218@8881a15 (aggregateGovernorPRModels) builds governorPRMostReworkedItem (:88) only for reworked PRs, and truncates to 10 (:279).
  • No handler path returns a model's PRs.

Wanted behavior

  • GET /api/governor/pr-models?window=…&model=<canonical id> returns the usual response plus a prs[] array: every PR in the window whose bucket is that canonical model.
    • The model is matched after modelfamily.Canonical, so raw spellings work too.
    • Each entry has the existing governorPRMostReworkedItem fields, plus outcome (merged / closed_unmerged / open), agent, created_at, merged_at and first_pass.
    • Sorted by review_rounds + fix_attempts descending, then created_at descending.
    • Capped at 200, with prs_truncated: true past that.
  • Without model, the response is unchanged and has no prs field.
  • The Governor card lets the viewer open a model's PR list from its row. A disclosure inside the row, or a small panel, matching how the Governor tab expands detail elsewhere. Each PR links to GitHub.

Acceptance criteria

  • model=claude-opus-5.5 and model=anthropic/claude-opus-5-5 return the same prs.
  • prs length equals the bucket's prs count (until the cap). The counts by outcome equal merged, closed_unmerged and open.
  • An unknown model returns an empty prs, not an error.
  • Without model, the JSON is byte-identical to today's.
  • Same authentication as the endpoint today. No PR bodies are returned, the same privacy as most_reworked.

Test plan (CI decides)

  • src/pkg/dashboard/api_governor_pr_models_test.go: new TestHandleGovernorPRModelsModelFilterListsPRs, with two models, mixed outcomes and a raw-spelling query. Assert membership, the counts invariant, the sort, and the cap (with 201 PRs). Assert the response without the filter is unchanged.
  • dashboard/test/governor-pr-models-ui.test.js: opening a row requests model=… and renders the list with links.
  • src/pkg/dashboard/governor_pr_models_ui_test.go: add the handler name.

Suggested implementation

  1. Parse model in handleGovernorPRModels and canonicalise it.
  2. Pass it into aggregateGovernorPRModels (an extra parameter, or a small options struct), and collect matching PRs while iterating.
  3. Reuse governorPRMostReworkedItem by embedding it in a new item type with the extra fields.
  4. governor-view.js: fetch on demand when a row is opened, and cache per window and model.
  5. Document the parameter in src/docs/.

Rejected options

  • A separate /api/governor/pr-models/{model} route. It would duplicate the window handling and authentication. A query parameter on the same handler reuses both.
  • Raise the most_reworked cap. It does not give per-model lists, and grows every response.

Out of scope / do not change

  • most_reworked and its cap.
  • Bucket aggregation.

Dependencies

None. It edits the same function as the per-backend/effort, per-repo/trend and outcome-reasons issues in this set. Land them one at a time and rebase.

Rules that apply to every issue in this set

  • Backward compatible. Existing response fields keep their names, types and meaning. Add new fields; never rename or repurpose one. Old dashboards and the admin MCP read these endpoints.
  • No new GitHub API calls without a cache. Everything here is computed from data the hive already holds: the scheduler's PR snapshot, the contributor task-run log and the token collector.
  • Tests. AGENTS.md forbids running go test, go build or go vet locally. Write the tests, run gofmt -l locally, and let CI decide. Node UI tests under dashboard/test/ run in CI too.
  • Changelog. Add a changelog.d/ fragment, as other dashboard PRs do.
  • Numbers. The evidence was pulled on 2026-11-17 between 9:10 and 9:20 AM EST, from the projectbluefin hive running a v6 edge build, 3b50113. It came through the same endpoints the dashboard reads: GET /api/governor/pr-models, GET /api/contribute/run-stats/models and GET /api/cost. The code paths quoted are identical on v5.

Activity

  1. added
    help wantedDenotes an issue that needs help from a contributor. Must meet "help wanted" guidelines.
    on Nov 17, 2026
  2. added and removed
    help wantedDenotes an issue that needs help from a contributor. Must meet "help wanted" guidelines.
    stage/010-actionableTriaged; eligible for the hive to pick up
    on Nov 17, 2026
  3. added
    help wantedDenotes an issue that needs help from a contributor. Must meet "help wanted" guidelines.
    on Nov 17, 2026
  4. hivecommons-hive commented on Nov 17, 2026

    @hivecommons-hive
    Contributor

    Hive status β€” updated in place; edits do not notify. Full history is in the Activity Monitor.

    PR #18785 covers this issue: #18785

    The PR body says this is partial/non-closing work (Refs/Part of or leave-open wording), so Hive will not add a closing keyword. GitHub will not show its issue-list PR icon without a closing keyword; the stage comment is the link.

  5. added
    hive/partially-addressedA merged PR addressed only part of this issue; remainder still actionable
    stage/010-actionableTriaged; eligible for the hive to pick up
    and removed on Nov 17, 2026
  6. hivecommons-hive commented on Nov 18, 2026

    @hivecommons-hive
    Contributor

    Verified once: hive#18785 merged to v5 and covers the wanted behavior (model= filter, prs[] with outcome/agent/timestamps, sort, 200 cap + prs_truncated, empty list for unknown model, unchanged response without model, per-row PRs button) with the planned tests. Resolved; a maintainer can close per the issue's Refs-only instruction.


    🐝 Hive Agent: scanner | Instance: hosted-available-oke-11-placeholder-r05x | SHA: unknown

    β€” hive: agent=scanner backend=claude model=claude-sonnet-5-5 claude=2.1.326

  7. clubanderson commented on Nov 18, 2026

    @clubanderson
    Member

    Closing by hand: delivered by #18785 (merged to v5). v5 merges with Refs do not auto-close, so a maintainer closes it after the merge.

  8. github-actions commented on Nov 18, 2026

    @github-actions
    Contributor

    @Danathar this issue was closed by @clubanderson 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

Labels

help wantedDenotes an issue that needs help from a contributor. Must meet "help wanted" guidelines.hive/partially-addressedA merged PR addressed only part of this issue; remainder still actionable

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions