Abstract
A reliable executable environment is the foundation for ensuring that large language models solve software engineering tasks. Due to the complex and tedious construction process, large-scale configuration is relatively inefficient. However, most methods always overlook fine-grained analysis of the actions performed by the agent, making it difficult to handle complex errors and resulting in configuration failures. To address this bottleneck, we propose EvoConfig, an efficient environment configuration framework that optimizes multi-agent collaboration to build correct runtime environments. EvoConfig features an expert diagnosis module for fine-grained post-execution analysis, and a self-evolving mechanism that lets expert agents self-feedback and dynamically adjust error-fixing priorities in real time. Empirically, EvoConfig matches the previous state-of-the-art Repo2Run on Repo2Run's 420 repositories, while delivering clear gains on harder cases: on the more challenging Envbench, EvoConfig achieves a 78.1% success rate, outperforming Repo2Run by 7.1%. Beyond end-to-end success, EvoConfig also demonstrates stronger debugging competence, achieving higher accuracy in error identification and producing more effective repair recommendations than existing methods.
Introduction
Large Language Models (LLMs) have demonstrated significant prowess in code generation, yet they frequently fail at the critical "last mile": establishing a functional execution environment. Setting up software environments—involving dependency management, version conflict resolution, and toolchain configuration—remains a tedious and error-prone task for both humans and autonomous agents. Existing agents often treat configuration as a linear command sequence, lacking the analytical depth to resolve complex errors like version mismatches or missing modules. This often leads to "infinite loops" of trial and error or "memory inflation," where reasoning is obscured by voluminous error logs.
Methodology
EvoConfig addresses these challenges by transitioning from a monolithic agent to a specialized multi-agent framework. The system is structured into three primary modules:
- Repository Env-info Extraction Module: This module acts as a "scout," scanning the repository to determine the project structure and dependency management strategy (e.g.,
pip,poetry). This provides high-impact "prior signals" to guide the configuration process. - Main Environment Configuration Module: Utilizing the ReAct framework, this agent focuses exclusively on action execution. It executes commands and relays outputs to the expert agent, maintaining a clean reasoning context.
- Self-Evolving Expert Diagnosis Module: The core of the system, this module analyzes execution feedback to categorize outcomes as success, failure, or risk. It can autonomously create diagnostic tools to verify hypotheses before suggesting fixes. Through a self-evolving mechanism, the expert agent adjusts its internal rules based on feedback, learning from errors in real-time without external database dependencies.
Experimental Evaluation
The performance of EvoConfig was evaluated across three benchmarks: Repo2Run (420 repositories), EnvBench (324 challenging Python repositories), and EnConda-Bench (4,201 instances for error perception).
Performance and Efficiency
EvoConfig matches or exceeds current state-of-the-art performance. On the standard Repo2Run benchmark, it achieved a 100% Dockerfile generation success rate (DGSR) and an 88.1% environment build success rate (EBSR). On the more rigorous EnvBench, EvoConfig reached a 78.1% success rate, a 7.1% improvement over Repo2Run.
Beyond success rates, EvoConfig significantly improves efficiency. It reduced average configuration time from 30.5 minutes to 20.9 minutes and lowered monetary costs by approximately 50% (from $0.33 to $0.16 per repository using GPT-3.5-turbo).
Debugging Competence
On EnConda-Bench, EvoConfig demonstrated superior diagnostic capabilities, achieving higher F1 scores for error identification (62.6) compared to Repo2Run (56.8). The separation of execution and diagnosis prevents the "Main Agent" from being overwhelmed by noisy logs, ensuring more accurate fix suggestions.
Conclusion and Future Work
EvoConfig demonstrates that decoupling execution from diagnosis and implementing a self-evolving feedback loop can significantly enhance the autonomy and efficiency of environment configuration. While highly effective at making environments runnable, future work will focus on extending these capabilities to logic error diagnosis (ensuring code behaves correctly) and expanding the language scope beyond Python to include C++, Java, and multi-language projects.
Summary updated