Skip to content

Budget PR review effort by PR size#11

Merged
markphelps merged 3 commits into
mainfrom
pr-review-budget-timeouts
Jun 18, 2026
Merged

Budget PR review effort by PR size#11
markphelps merged 3 commits into
mainfrom
pr-review-budget-timeouts

Conversation

@markphelps

Copy link
Copy Markdown
Contributor

Summary

  • add tiered PR review budgets based on changed files and line counts
  • enforce review wall-clock timeout with deterministic timeout comments
  • pass reviewBudget into the code-review skill and document budget rules

Test Plan

  • node --test test/*.test.mjs
  • pnpm build
  • npx -p typescript tsc --noEmit -p tsconfig.json

Signed-off-by: Mark Phelps <209477+markphelps@users.noreply.github.com>
* 'main' of https://github.com/flipt-io/agents:
  feat(pr-review): update existing bot review comment (#10)

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verdict: approve

Well-defined PR review budget policies are introduced and enforced, with sound tier rules and deterministic timeout handling. All changes are clear; only tiny nits could further polish minor behavior. No changes required for correctness or clarity.

lib/review-timeout.ts

  • nit (L80): In the timeoutReviewResult function, template literals are used to format the duration in seconds, but Math.round(timeoutMs / 1000) will lose milliseconds (e.g., 1599ms rounds down to 1s). For consistency with test/review-timeout.test.mjs (which expects 2s for 1500ms) you may want to consistently round up (Math.ceil()). Minor, discretionary.

workflows/pr-review.ts

  • nit (L136): The fallback stats used before reviewStats are fetched (changedFiles: 999, additions: 1000, deletions: 0) are highly conservative, which is intentional, but may lead to over-budgeting if stats fetch fails. Consider annotating the code with rationale or tuning the fallback numbers based on most common PR size range. No action needed unless it's affecting review behavior.

🤖 Automated review by the Flipt PR review agent.

@markphelps markphelps merged commit 81ca4ec into main Jun 18, 2026
1 check passed
@markphelps markphelps deleted the pr-review-budget-timeouts branch June 18, 2026 12:07
markphelps added a commit that referenced this pull request Jun 19, 2026
markphelps added a commit that referenced this pull request Jun 23, 2026
* origin/main:
  Use target repo labels directly (#14)
  Add workflow-specific local config directory (#13)
  chore: update gitignore
  Add Issue Health Check agent (#12)
  fix(pr-review): relax hard timeout budget
  Budget PR review effort by PR size (#11)
  feat(pr-review): update existing bot review comment (#10)
  chore: update gitignore
  perf(pr-review): make reviews more decisive to cut runtime and tokens
  refactor: read per-repo overrides from .agents/ instead of .flue/
  feat(models): document Kimi K2.6 on Cloudflare Workers AI (#9)
  feat: brand the review footer as Flipt and link the agents repo
  feat: factor prior PR reviews/comments into the review (avoid repeats, respect decisions) (#8)
  feat: connect the Flipt docs MCP so the reviewer can query the docs (#7)
  docs: reposition README as the Flipt agents fleet (PR Review = first agent) (#6)
  fix: post reviews deterministically from the workflow (not the model) (#5)
  fix: drop setup-node pnpm cache so the action works when consumed cross-repo (#4)
  fix: make the PR review agent run end-to-end (gh token + gpt-5-mini) (#3)
  feat: run on GitHub Models with a free default; clarify AGENTS.md (#1)
  feat: initial commit

# Conflicts:
#	lib/issue-health.ts
#	skills/issue-health/SKILL.md
#	test/issue-health.test.mjs
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.

1 participant