open-code-review icon indicating copy to clipboard operation
open-code-review copied to clipboard

PR-aware reviews

Open mogul opened this issue 5 months ago • 5 comments

Problem Statement

OCR reviews do not take into consideration previous discussions or feedback in a PR. They only look at code differences. So if there is

  • another AI or other people leaving feedback
  • discussions and responses with important context about intent and trade-offs decided
  • previous posts and comments from OCR

Then all of that is ignored by OCR. The resulting review feel disconnected, particularly compared with, say, what CodeRabbit does.

Proposed Solution

When I invoke OCR reviews from a GitHub Action, I want to specify a file full of "prior context" that will be first summarized using a first inference request to the configured LLM. Then I want the summary provided as context in the second, actual review request to the configured LLM. The response should not include duplicative findings, only new ones.

Alternatives Considered

No response

Affected Area

Review Agent / LLM interaction

Additional Context

No response

mogul avatar Jun 06 '26 06:06 mogul

I encountered a similar issue. In the previous review round, OCR produced a mix of valid suggestions and false positives. However, there is no way for me to flag the false positives as incorrect, so the same erroneous suggestions keep resurfacing in subsequent review rounds.

zshs000 avatar Jun 06 '26 09:06 zshs000

Thanks for the detailed write-up, @mogul — and @zshs000 for sharing the related pain point about false positives resurfacing.

This is something we've been thinking about internally. The core challenge is that OCR is designed to be stateless by nature (each invocation is independent), which keeps things simple and predictable but, as you've pointed out, leads to disconnected reviews that ignore prior context and repeat dismissed suggestions.

We're currently designing an approach to solve this. Our thinking is leaning toward filesystem-based mechanisms to manage state across review instances — for example, persisting prior review context or resolution signals in a way that subsequent runs can pick up without requiring a centralized service. This would fit well with CI-based workflows where the filesystem (or artifacts) is the natural coordination layer.

Still in the design phase, but this is on our radar. We'll update this issue as the approach solidifies. Feedback and ideas are welcome in the meantime.

lizhengfeng101 avatar Jun 08 '26 13:06 lizhengfeng101

I think just giving us a way to refer to additional context on disk when invoking OCR is enough; we don't need OCR to manage where that context comes from or how it's persisted, particularly since that context won't just be the output of previous OCR runs. The CI workflow would first run the gh CLI to populate a file with the previous comments (produced by previous OCR runs, humans, and other agents), and then include that file when invoking OCR.

On Mon, Jun 8, 2026, 6:37 AM lizhengfeng @.***> wrote:

lizhengfeng101 left a comment (alibaba/open-code-review#59) https://github.com/alibaba/open-code-review/issues/59#issuecomment-4649537382

Thanks for the detailed write-up, @mogul https://github.com/mogul — and @zshs000 https://github.com/zshs000 for sharing the related pain point about false positives resurfacing.

This is something we've been thinking about internally. The core challenge is that OCR is designed to be stateless by nature (each invocation is independent), which keeps things simple and predictable but, as you've pointed out, leads to disconnected reviews that ignore prior context and repeat dismissed suggestions.

We're currently designing an approach to solve this. Our thinking is leaning toward filesystem-based mechanisms to manage state across review instances — for example, persisting prior review context or resolution signals in a way that subsequent runs can pick up without requiring a centralized service. This would fit well with CI-based workflows where the filesystem (or artifacts) is the natural coordination layer.

Still in the design phase, but this is on our radar. We'll update this issue as the approach solidifies. Feedback and ideas are welcome in the meantime.

mogul avatar Jun 08 '26 15:06 mogul

@lizhengfeng101 are there any updates on this one? I am also interested in that feature

thurnbauermatthi avatar Aug 13 '26 08:08 thurnbauermatthi

Hi @thurnbauermatthi — thanks for checking in.

We've been working on this, but progress has been slower than we'd like. We tried a few approaches and the results haven't been satisfying so far.

Our current implementation adds a dedicated section in the main_task_user prompt to include existing PR comments as context during review. However, the quality of the output with this approach hasn't met our expectations in the examples we've tested.

If anyone has ideas or experience with a better approach for incorporating prior discussion context into LLM-based reviews, we'd love to hear them. We're very much looking for a solution that produces reliably good results.

lizhengfeng101 avatar Aug 13 '26 08:08 lizhengfeng101