Bound scheduled PR review intake across OSS repositories

Abierto
#656 7 comentarios 0 reacciones 1 asignado Ver en GitHub

Los mantenedores suelen responder en 1 día

@all-hands-bot ya está trabajando en esto.

Desde el 22/9/2026.

Evaluación

Este issue todavía no se ha evaluado.

Descripción

priority:high ready-for-dev

Problem

The GitHub PR reviewer can resume outstanding all-hands-bot requests on a scheduled scan (Extensions #654, stacked on #651), but one scan can start a conversation for every eligible PR it finds. The four main OSS repositories currently have hundreds of open non-draft PRs lacking a review on their current head. Requesting reviews for all of them at once would overload the 15 GiB OSS Agent Canvas VM; four simultaneous agent jobs plus retained Docker runtimes caused an OOM restart on 2026-09-22.

Desired behavior

The scheduled reviewer drains outstanding requests fairly while bounding new agent conversations. It should reuse the existing reviewer delivery and dedupe machinery, not create a separate queue or runtime layer.

Acceptance criteria

  • A configurable small maximum (default 2) limits new review conversations per scheduled run across all configured repositories. Scanning CI, reconciling completed reviews, and maintainer handoff remain possible even when the new-conversation limit is reached.
  • Eligible PRs are ordered deterministically and fairly by the oldest outstanding reviewer-request event, with repository and PR number as tie-breakers. A failing or pending PR does not consume a conversation slot or prevent later eligible PRs from being considered.
  • Repeated scans never create a second conversation or native review for the same request event and head SHA. A later request or changed head can be reviewed under the existing semantics.
  • A focused test with at least three eligible PRs across two repositories demonstrates that one scan starts at most two conversations and a later scan reaches the remaining PR. Include a pending-check candidate ahead of a green candidate to verify it does not block the queue.
  • The live OSS Agent Canvas canary demonstrates bounded intake without exhausting memory. Include links to the PRs and conversations in the PR's AGENT evidence.

Scope

This is general reviewer scheduling in OpenHands/extensions. Do not add repo-specific policy or VM-specific control to the extension. Stack the PR on #654 if its scheduled-request scan is required; otherwise target the earliest applicable base. Do not merge automatically.


OpenHands AI triage

The following comments and acceptance criteria were added by the OpenHands AI agent.

Triage

The change is bounded scheduling work in the existing reviewer automation, so no further design decision is needed. It belongs in skills/github-pr-reviewer/scripts/worker.py, reusing the machinery #654 already added: the AgentConversationDispatcher.deliver delivery keyed by reviewer-request event and head SHA, _finish_completed_review, the exact-head check gate, and run_repositories. No queue or runtime layer is added. Because the maximum is per scheduled run across repositories while each repository is currently scanned independently, the budget has to be shared across the per-repository loop instead of resetting per repository; and because ordering is by the oldest outstanding request across repositories, the scheduled scan must collect and order candidates before dispatching, while keeping the existing per-repository failure isolation. Configure the maximum through the worker's rendered config, following the max_new_per_run key that github-issue-to-pr, gitlab-issue-to-mr, and github-agents-md-maintainer already use, with a default of 2.

Stack on #654, whose outstanding-request scan supplies the oldest-request ordering; #651 and #654 must merge first. Neither PR is merged or deployed automatically, and the OSS deployment change is out of scope here.

Non-goals: no repository-specific policy, VM tuning, or deployment control in OpenHands/extensions; no second automation record; no new GitHub webhook event types, check_run parsing, or permission scopes; no change to the review prompt, verdict parsing, maintainer handoff, secret selection, the trigger-label scan, or the explicit review_requested event path.

The issue's live canary depends on the OSS deployment accepting a scheduled dispatch; #654 recorded the Canvas automation service as unreachable for create and dispatch mutations on this host, so the PR should state the live evidence it actually obtained.

Acceptance Criteria
  • A single scheduled run starts at most a configurable maximum of new review conversations across all configured repositories, defaulting to 2 when unset. The maximum bounds the conversations a run starts rather than the candidates it inspects, so deliveries that only deduplicate or report an already-running conversation do not consume it.
  • After the maximum is reached, the same run still completes its non-dispatching work for the remaining eligible candidates: exact-head check evaluation and gate comments, completed-review reconciliation, and maintainer handoff. The scan is not cut short.
  • Eligible candidates are ordered by the oldest outstanding all-hands-bot review_requested event, then by repository, then by pull-request number. When more candidates are eligible than the maximum allows, the oldest-request candidates start conversations first and a later scheduled scan reaches the remainder.
  • A candidate whose exact-head checks are pending or failing posts its waiting or blocked disposition, starts no conversation, consumes none of the maximum, and does not prevent a later eligible candidate from being considered in the same run.
  • A dispatch that raises is reported and does not abort the run or the other repositories, and does not prevent the remaining candidates from being considered.
  • Repeated scheduled scans never start a second conversation or publish a second native review for the same reviewer-request event and head SHA; a later request event or a changed head is reviewed under the existing delivery-key semantics.
  • The trigger-label scan and the explicit review_requested event path keep their current behavior; only the scheduled scan's new conversations are bounded.
  • No new secret, token scope, or GitHub permission is required, and no secret value appears in logs, comments, or the PR.
  • A focused automated test driving the shipped reviewer entrypoint through the existing catalog-bundle test helper asserts that, with at least three eligible PRs across two repositories, one scheduled scan starts at most two conversations and a later scan reaches the remaining PR; that a pending-check candidate ordered ahead of a green candidate consumes no slot and does not block the green candidate; and that a repeated scan creates no duplicate conversation.
  • The reviewer SKILL.md and README.md document the per-run maximum, its default, and that it applies per scheduled run across repositories, and the catalog entry's bundle and entry versions are bumped with generated catalogs regenerated so python scripts/sync_extensions.py --check and npm run build report no drift.
  • Live evidence in the PR's AGENT section links the OSS Agent Canvas scheduled run's pull requests and conversations and shows the run started no more than the configured number of conversations without exhausting the VM.
Lenguaje dominante
Python
Estrellas
184
Forks
137
Merge medio
1 d 19 h
PR fusionados (30 d)
46

Preparar el entorno

  • Sin Dockerfile ni archivo de Docker Compose
  • Tiene una plantilla de pull request
  • Sin guía de contribución

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de OpenHands/extensions

Todos los issues de OpenHands/extensions

Issues similares

Más issues de Python

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.