← Back to Paper List

MarsCode Agent: AI-native Automated Bug Fixing

Yizhou Liu, Pengfei Gao, Xinchen Wang, Jie Liu, Yexuan Shi, Zhao Zhang, Chao Peng
Harbin Institute of Technology, Shenzhen
arXiv.org (2024)
Agent KG Benchmark

📝 Paper Summary

Multi-agent collaboration Automated Program Repair (APR)
MarsCode Agent automates bug fixing by coordinating specialized agents equipped with IDE-native tools like Language Server Protocols and Code Knowledge Graphs to replicate human debugging workflows.
Core Problem
Applying LLMs to real-world bug fixing is difficult because they struggle to navigate complex file dependencies, lack precise fault localization context, and often generate syntactically incorrect patches or invalid line numbers.
Why it matters:
  • Traditional heuristic-based repair tools have limited scope and cannot adapt to novel bugs
  • Simple LLM prompting fails on large repositories where the bug involves cross-file dependencies
  • Standard LLM edit formats (like unified diffs) are fragile due to line number hallucinations, breaking the patch application process
Concrete Example: When an LLM attempts to generate a 'unified diff' format patch, it frequently miscalculates line number increments, causing the patch to fail. Furthermore, without a reproduction script, an agent might 'fix' code but introduce new syntax errors that go undetected until manual review.
Key Novelty
IDE-Native Multi-Agent Collaboration
  • Integrates 'Language Server Protocol' (LSP) and 'Code Knowledge Graphs' (CKG) directly into the agent's toolset, allowing it to navigate definitions and references exactly like a human developer in an IDE
  • Uses a conflict-marker based editing strategy (AutoDiff) combined with LSP static syntax checking to ensure generated patches are syntactically valid and free of line-number errors
  • Deploys a dynamic planning system that chooses between a 'static repair' path (direct editing) or a 'dynamic debugging' path (reproduction -> fix -> verify) based on issue complexity
Architecture
Architecture Figure Figure 1
The multi-agent collaboration framework showing the roles and their interactions
Breakthrough Assessment
7/10
Strong engineering contribution integrating standard developer tools (LSP/CKG) into an agent framework. While the multi-agent concept is known, the specific tooling implementation for robustness is valuable.
×