# Debates, voting, and reflection loops: composing an agentic PR reviewer that costs less than a dollar

DevFeed: [Debates, voting, and reflection loops: composing an agentic PR reviewer that costs less than a dollar](<https://devfeed.tech/articles/debates-voting-and-reflection-loops-composing-an-agentic-pr-reviewer-that-costs-less-than-a-dollar-116297.md>)

Original publisher: [Read original article](<https://quarkus.io/blog/agentic-pr-reviewer/>)

Author: Mario Fusco (https://twitter.com/mariofusco)

Published: 2026-11-04T00:00:00Z

Content type: article

Language: en

Sources: [Quarkus - Supersonic Subatomic Java](<https://devfeed.tech/sources/quarkus-supersonic-subatomic-java.md>)

Topics: [agent orchestration](<https://devfeed.tech/topics/agent-orchestration.md>), [Agentic AI](<https://devfeed.tech/topics/what-is-agentic-ai.md>), [llm-reasoning](<https://devfeed.tech/topics/llm-reasoning.md>), [Pull Request](<https://devfeed.tech/topics/pull-request.md>)

Tags: [abstraction](<https://devfeed.tech/tags/abstraction.md>), [agentic](<https://devfeed.tech/tags/agentic.md>), [agents](<https://devfeed.tech/tags/agents.md>), [anthropic](<https://devfeed.tech/tags/anthropic.md>), [api](<https://devfeed.tech/tags/api.md>), [application](<https://devfeed.tech/tags/application.md>), [budget](<https://devfeed.tech/tags/budget.md>), [chat](<https://devfeed.tech/tags/chat.md>), [comment](<https://devfeed.tech/tags/comment.md>), [confidence](<https://devfeed.tech/tags/confidence.md>), [cost](<https://devfeed.tech/tags/cost.md>), [costs](<https://devfeed.tech/tags/costs.md>), [coverage](<https://devfeed.tech/tags/coverage.md>), [decision-model](<https://devfeed.tech/tags/decision-model.md>), [decision-models](<https://devfeed.tech/tags/decision-models.md>), [documentation](<https://devfeed.tech/tags/documentation.md>), [loops](<https://devfeed.tech/tags/loops.md>), [pr](<https://devfeed.tech/tags/pr.md>), [reflection](<https://devfeed.tech/tags/reflection.md>), [voting](<https://devfeed.tech/tags/voting.md>)

## AI overview

The reviewer combines a deterministic Quarkus sequence with model-driven routing and judgment: a decision model selects relevant specialists, while code handles fetching, finding validation, score calibration, and report assembly. Conditional coverage reviews, chunking for large diffs, debates for uncertain findings, voting for borderline scores, and a capped reflection loop add extra review only when triggered. It uses tiered models, retries transient failures, and discloses skipped work; a read-only GitHub token and human approval keep the process bounded. On the reported 2,900-line, 56-file pull request, it took 5 minutes 49 seconds and cost $0.45. It found a source-compatibility issue, rejected a disputed binary-compatibility finding, and exposed a weak report critic that failed to improve its score across three rounds.

## Source excerpt

At the moment when I write this, the LangChain4j project has received 1,698 pull requests since the beginning of this year. Reviewing them all is a lot of work, and we wanted an agentic system to help. But a single pattern can't do it: routing, debating, voting and reflection all need to work together, within a cost budget, in a real Quarkus application. Here's how we built one that reviews a 2900-line pull request for $0.45. In previous articles we discussed why no single agentic pattern can cover all use cases, introducing a generic Planner abstraction to define custom orchestration strategies, and we showed how the voting pattern and dynamic chat model selection make an agentic system more reliable and more cost-efficient. Each of those articles focused on one pattern, applied to a deliberately small example. This time we want to see what happens when many of these patterns have to work together in a real application, with real costs, real failures, and a human who wants to have the last word. Given a pull request, the reviewer produces a report saying what is good, what is wrong and what could be improved, with every problem anchored to a file and a line of the diff. It also gives a score from 0 to 10 for usefulness, correctness, conciseness, security, test coverage, maintainability, API and documentation, and PR hygiene, plus an overall score with its confidence, and a verdict: APPROVE, COMMENT or REQUEST_CHANGES. It only reads GitHub, with a read-only token, and never writes to it: its output is a Markdown report, the same report in JSON, and an HTML trace of the execution of its agents. The reviewer is a Quarkus application built with the Quarkus LangChain4j extensions, version 1.15 on LangChain4j 1.21: quarkus-langchain4j-agentic for the agents, the Anthropic and OpenAI extensions for the chat models, quarkus-langchain4j-typesafe for the decision model (where TypeSafe is the company behind the Jev decision models), and quarkus-github-api to read GitHub. The