用专用工具让大模型更高效修复安卓构建错误。
Automating Android Build Repair: Bridging the Reasoning-Execution Gap in LLM Agents with Domain-Specific Tools
- 设计专用工具链,让大模型直接操作Gradle环境。
- 在1019个真实构建失败上达到81.4%修复率。
- 适合想提升安卓自动化构建能力的开发者。
Android是最大的移动平台,但自动构建应用仍具挑战。我们提出AndroidBuildBench,一个包含43个开源项目提交历史中整理出的1,019个构建失败的基准数据集,每个问题均配有后续提交中的验证修复方案。针对此,我们设计了GradleFixer,一种具备领域专用工具的LLM代理,可检查并操作Gradle构建环境。其在pass@1指标下达到81.4%的解决率,显著优于依赖通用壳命令的先进编码代理。结果表明,尽管大模型具备高层知识,但在使用通用壳命令时难以转化为有效低层操作。我们提出的“工具桥接”策略,以领域感知抽象替代通用命令,通过提供类API工具接口和限制动作空间,弥合了模型高层推理与有效低层执行之间的鸿沟。
原文摘要 · Abstract (English)
Android is the largest mobile platform, yet automatically building applications remains a practical challenge. While Large Language Models (LLMs) show promise for code repair, their use for fixing Android build errors remains underexplored. To address this gap, we first introduce AndroidBuildBench, a benchmark of 1,019 build failures curated from the commit histories of 43 open-source Android projects. Each problem is paired with a verified solution from a subsequent commit, ensuring that fixes are feasible. Second, we propose GradleFixer, an LLM agent with domain-specific tools for inspecting and manipulating the Gradle build environment. GradleFixer achieves a resolve rate of 81.4% (pass@1), significantly outperforming a state-of-the-art coding agent that relies on a general-purpose shell. GradleFixer's success suggests that while LLMs possess the high-level knowledge to solve these failures, they struggle to translate this knowledge into effective low-level actions using a general-purpose shell. We demonstrate the effectiveness of a strategy we term Tool Bridging, which replaces general-purpose shell commands with domain-aware abstractions. We hypothesize this approach works through two mechanisms: 1) it provides tools in an API-like format that LLMs use more reliably, and 2) it constrains the action space to relevant operations. This approach bridges the gap between the model's high-level reasoning and effective low-level execution.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。