





















https://alibaba.github.io/open-code-review/
https://github.com/alibaba/open-code-review/tree/main
Open Code Review is an AI-powered code review CLI tool. It originated as Alibaba Group's internal official AI code review assistant — over the past two years, it has served tens of thousands of developers and identified millions of code defects. After thorough validation at massive scale, we incubated it into an open source project for the community. Simply configure a model endpoint to get started.
It reads Git diffs, sends changed files to a configurable LLM via an agent with tool-use capabilities, and generates structured review comments with line-level precision. The agent can read full file contents, search the codebase, inspect other changed files for context, and produce deep reviews — not just surface-level diff feedback.
If you've used general-purpose agents like Claude Code with Skills for code review, you've likely encountered these pain points:
The root cause: a purely language-driven architecture lacks hard constraints on the review process.
Open Code Review's core philosophy is to combine deterministic engineering with an agent, each handling what it does best.
Deterministic Engineering — Hard Constraints
For review steps that must not go wrong, engineering logic — not the language model — guarantees correctness:
message_en.properties and message_zh.properties are bundled together). Each bundle runs as a sub-agent with isolated context — a divide-and-conquer strategy that stays stable on very large changesets and naturally supports concurrent review.Agent — Dynamic Decision-Making
The agent's strengths are concentrated where they matter most — dynamic decisions and dynamic context retrieval:
Open Code Review (short ocr) is an AI-powered code review CLI tool.
Core Features:
An AI Agent that reads files, searches the codebase, cross-references context, and applies fine-grained rules for deep review.
Decouples deterministic engineering (task splitting, file filtering, line-number positioning, rule routing, async scheduling) from LLM Agent reasoning (risk detection, context exploration, issue classification) — engineering modules handle certainty, Agents handle semantics, optimizing quality, token cost, and speed.
An independent line-level comment positioning module with a 3-tier progressive LLM strategy pinpoints each comment to exact line numbers. A separate reflection module intercepts hallucinations and knowledge drift early.
Supports both Anthropic Messages API and OpenAI Chat Completions API. Connect custom model endpoints.
Dynamically splits sub-tasks for parallel review with configurable goroutine workers (default 8). Even large changesets complete quickly.
Purpose-built memory compression for code review with 3-tier partitioning (frozen/compress/active) context management, breaking token limits for deep review.
Review rules validated through massive real-world scenarios, covering 10+ languages including Java, TypeScript, Go, Python, Kotlin, C++, C, with specialized rules for NPE, thread safety, XSS, SQL injection, and more.
出处:http://www.cnblogs.com/lightsong/ 本文版权归作者和博客园共有,欢迎转载,但未经作者同意必须保留此段声明,且在文章页面明显位置给出原文连接。
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。