AI时代代码审查需从人工检查转向人机协同的智能代理流程
Rethinking Code Review in the Age of AI: A Vision for Agentic Code Review

- 构建五阶段端到端框架,用AI代理跨阶段传递上下文
- 人类在关键节点保留决策权,确保责任与团队理解
- 适合关注AI辅助开发流程优化的工程师和研发管理者
代码审查历经数十年发展,从非正式同行检查演变为今日的拉取请求(PR)工作流,但仍以人工为主且认知负荷高。人工智能编码助手虽提升了代码生成速度,却也增加了需审查的代码量,使代码审查成为日益严重的瓶颈。当前AI支持分散于评审推荐、PR描述生成、评论建议等孤立任务,缺乏对全流程的整合。本文提出将审查效果视为全生命周期的产出,而非单一环节,并构建一个跨阶段传递上下文的框架。我们展望未来:审查者从手动检查员转变为智能代理的监督者。通过分阶段的AI工作流,实现代码生成速度与团队共识、工程责任的同步。本文回顾代码审查发展历程,分析传统系统挑战,探讨大语言模型(LLMs)与智能体系统带来的变革。提出融合专用代理与人为质量门控的AI驱动审查流程,涵盖五个阶段:PR创建、PR增强、评审者选择、AI辅助代码审查、PR回顾。人类在关键决策点介入,保障判断力、问责制与团队理解。最后,识别采纳挑战,提出评估、治理与负责任人机协作的研究方向。
原文摘要 · Abstract (English)
Code review has evolved for decades, from informal peer checking to today's pull request (PR) workflows, yet it remains a largely manual and cognitively demanding process. The rise of Artificial Intelligence (AI) coding assistants has intensified this challenge: while these tools increase code production velocity, they also expand the volume of code requiring review, turning code review into a growing bottleneck. Current AI support in code review remains fragmented, with tools focusing on isolated tasks such as reviewer recommendation, PR description generation, or comment suggestion rather than the end-to-end PR review workflow. We address this gap by treating review effectiveness as an outcome of the full code review lifecycle rather than a single stage, proposing a framework that carries context across stage boundaries. We propose a future vision for code review in which reviewers transition from manual inspectors into supervisory operators of agents. In this vision, staged, AI-powered workflows aim to align the pace of code generation with shared understanding and accountable engineering. In this paper, we review the historical evolution of code review practices, identify challenges in traditional code review systems, and examine the shift driven by large language models (LLMs) and agentic AI systems. We then present a vision for an AI-powered code review workflow combining specialized agents with human-controlled quality gates. Our framework spans five stages: PR Creation, PR Augmentation, Reviewer Selection, AI-Assisted Code Review, and PR Retrospective, with humans retained at key decision points to preserve judgment, accountability, and team-level understanding. Finally, we identify key adoption challenges and outline research directions for evaluation, governance, and responsible human-AI collaboration.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。