BetaLenzon is in beta — the Free tier is 100% free while we're in beta (bring your own Anthropic key, public repos).See plans →
Lenzon

alibaba/open-code-review — open-code-review: AI Code Review with Engineering Guardrails

alibaba/open-code-review ·

Loading…

Transcript

QuickFacts

Welcome! Today we're exploring open-code-review from Alibaba. This is an AI code review tool that's designed a little differently. It splits the job between deterministic engineering logic and LLM agents, so you get both reliability and smart reasoning.

PlainEnglish

Here's what it does. It parses your git diffs, filters files by extension and path rules, then dispatches concurrent review tasks. The LLM gets a toolkit to read files, search code, and submit comments. And critically, it uses a multi-tier resolver to match code snippets to exact line numbers. So you get inline comments that actually point to the right place.

PlainEnglish

Think of it like a restaurant kitchen. The head chef handles the menu, sources ingredients, and plates each dish. That's the engineering layer deciding which files to review and bundling them. The line cooks improvise within their stations, tasting and adjusting seasoning. That's the LLM, dynamically deciding what to inspect. The chef never lets the cooks wander off to buy groceries mid-service, and the cooks never touch the menu. Clear division of labor prevents chaos.

QuickFacts

Let's look at the stack. It's a Go CLI, built on Go one point two five. Charm Bubble Tea powers the interactive config wizards. For LLM integrations, it uses the official Anthropic and OpenAI SDKs, plus tiktoken for token counting. It also supports the Model Context Protocol, so you can plug in external tool servers. And OpenTelemetry handles observability.

Architecture

Here's the high-level architecture. The CLI entry point routes your review or scan command to the agent orchestrator. The agent calls the diff parser to generate unified diffs, then dispatches per-file subtasks. Each subtask runs the LLM tool loop, which sends requests to the LLM client and executes tool calls via the tool registry. When the LLM submits a comment, the line resolver matches code snippets to exact line numbers. It's a clean pipeline with clear boundaries.

Architecture

Let's trace a review. You run the command with from and to branches. The agent asks the diff parser to generate unified diffs. It gets back a list of diffs with hunks and full file content. The agent filters by path rules, bundles related files, then dispatches per-file subtasks. Each subtask runs the LLM loop, which sends messages and tool definitions to the LLM. The LLM responds with tool calls like file read or code comment. The loop executes those tools, resolves line numbers, and hands comments back to the agent. Finally, the agent emits JSON output.

Architecture

Here's the secret sauce: line number resolution. When the LLM returns a comment with a code snippet, the system first tries to match it against the diff hunks. That's fast and works most of the time. If that fails, it scans the full file line-by-line. Still no match? It calls the LLM again with a specialized prompt to regenerate a precise snippet, then retries. This multi-tier cascade is why the tool reports accurate line numbers even when the LLM's initial output is approximate.

Architecture

As the conversation grows, the system partitions messages into three zones. The first round stays frozen and verbatim, never compressed. The middle section gets condensed into an LLM-generated summary when the conversation hits sixty to eighty percent of the token budget. The last few rounds stay active, word-for-word, so the LLM has full context for recent exchanges. Compression jobs run asynchronously in the background, and if tokens spike past eighty percent, it runs synchronously to avoid breaching the context window.

Architecture

The LLM client layer supports three protocols out of the box. The resolver merges provider presets with user config and environment variables, then dispatches to the right client. Anthropic Client uses the Messages API with prompt caching on the last system or tool block. OpenAI Chat supports streaming and extracts reasoning content. And OpenAI Responses is stateless, using a prompt cache key per session. You can switch from Claude to GPT with a one-line config change. Eighteen providers are built-in, from Alibaba DashScope to local Ollama.

Community

Let's check the community pulse. The repo shows an active signal, with the last commit landing yesterday. There's one contributor in the last ninety days, Sisanta Chhatoi, who's been active. The repo has three branches and no tags yet. It's a young project with active development, though the contributor base is still small.

PlainEnglish

So here's the takeaway. Open Code Review shows you can have both: the flexibility of AI reasoning and the reliability of deterministic engineering. The LLM decides what to inspect, but the engineering layer guarantees which files get reviewed and where comments land. That's how you ship a code review tool that's both smart and precise.

How this was made

Lenzon read alibaba/open-code-review and generated this walkthrough automatically. The narration above is the transcript of what it says.

Explain a pull request from your own repo

Point Lenzon at a repo or a pull request and get a narrated walkthrough like this one.

Try it
alibaba/open-code-review — open-code-review: AI Code Review with Engineering Guardrails