Abstract
Recent developments in Large Language Model (LLM) agents are revolutionizing Autonomous Software Engineering (ASE), enabling automated coding, problem fixes, and feature improvements. However, localization — precisely identifying software problems by navigating to relevant code sections — remains a significant challenge. Current approaches often yield suboptimal results due to a lack of effective integration between LLM agents and precise code search mechanisms. This paper introduces OrcaLoca, an LLM agent framework that improves accuracy for software issue localization by integrating priority-based scheduling for LLM-guided action, action decomposition with relevance scoring, and distance-aware context pruning. Experimental results demonstrate that OrcaLoca becomes the new open-source state-of-the-art (SOTA) in function match rate (65.33%) on SWE-bench Lite. It also improves the final resolved rate of an open-source framework by 6.33 percentage points through its patch generation integration.
Introduction
Autonomous Software Engineering (ASE) has advanced rapidly with the emergence of Large Language Model (LLM) agents like Devin and OpenHands. These agents aim to automate the full software development lifecycle, from feature implementation to bug fixing. However, the effectiveness of these agents is often bottlenecked by their ability to perform localization: the process of identifying the specific files and functions responsible for a reported issue. In large-scale repositories containing thousands of files, this task is akin to finding a needle in a haystack.
Existing agents often struggle with the scale and complexity of modern codebases, leading to redundant search behaviors or context window saturation. To address these limitations, we present OrcaLoca, a specialized LLM agent framework designed to bridge the gap between high-level reasoning and precise code navigation. By combining graph-based structural analysis with dynamic action scheduling, OrcaLoca achieves superior localization accuracy while maintaining cost efficiency.
Problem Statement
Current LLM-based localization approaches face three primary hurdles:
- Unstable Planning: Agents often lack a robust memory of their search history, leading to circular reasoning or repetitive actions when an initial search fails.
- The Context Dilemma: Providing too little information prevents the agent from understanding the code, while providing too much (such as massive file skeletons) introduces "noise" that degrades LLM performance.
- Rigid Navigation: Many tools rely on fixed directory traversals, which prevent agents from jumping between logically related but structurally distant components of a codebase.
Methodology
OrcaLoca addresses these challenges through a multi-layered architectural approach centered on structured navigation and intelligent context management.
Priority-Based Action Scheduling (ASQ)
To prevent aimless wandering, OrcaLoca implements an Action Scheduler Queue (ASQ). Unlike standard agents that decide the next step in a vacuum, the ASQ ranks potential actions by priority. If the LLM repeatedly suggests a specific search or file inspection, the system recognizes the increased "urgency" and moves that action to the front of the queue, ensuring the agent remains focused on high-signal leads.
Action Decomposition and Relevance Scoring
When an agent identifies a large class or file for inspection, OrcaLoca avoids dumping the entire source code into the prompt. Instead, it utilizes a specialized sub-agent to perform Action Decomposition. This sub-agent generates a summary of the file's methods and assigns a relevance score to each. Only the most relevant snippets are presented to the primary agent, keeping the context window lean and focused.
Distance-Aware Context Pruning
OrcaLoca constructs a CodeGraph, a structural map of the repository that tracks nesting and call relationships. By calculating the "structural distance" between search results and suspected bug locations, the framework can automatically prune irrelevant code. If a function is structurally "too far" from the current area of interest, it is removed from the context to prevent the LLM from becoming distracted by unrelated logic.
Reproducer Agent
Before the main search begins, an auxiliary Reproducer Agent attempts to execute the codebase and reproduce the reported error. If successful, the resulting stack trace provides a high-priority starting point for the localization process, effectively "warming up" the search with concrete evidence of the failure path.
Experimental Evaluation
OrcaLoca was evaluated using the SWE-bench (Software Engineering Benchmark) suite, specifically focusing on:
- SWE-bench Lite: 300 real-world GitHub issues for leaderboard comparison.
- SWE-bench Verified: 500 instances curated for high reliability.
- SWE-bench Common: A subset of 93 instances used for detailed ablation studies to determine the impact of individual framework components.
Results and Discussion
OrcaLoca establishes a new benchmark for open-source localization agents. On the SWE-bench Lite leaderboard, it achieved a 65.33% function match rate, outperforming previous open-source state-of-the-art models.
When integrated with the Agentless-1.5 patch-generation tool, OrcaLoca resolved 41.00% of the issues, representing a 6.33 percentage point improvement over the baseline. Furthermore, the framework proved to be highly efficient, with an average cost of approximately $0.87 per instance in LLM tokens. Notably, OrcaLoca successfully localized 6 issues and resolved 8 issues that no other open-source agent on the leaderboard had previously solved.
Conclusion and Future Work
OrcaLoca demonstrates that imposing structure on LLM reasoning—through graph-based navigation and prioritized scheduling—is essential for navigating complex software repositories. While currently optimized for Python, the framework's principles are language-agnostic. Future work will focus on expanding support to polyglot systems (e.g., Python calling C++) and optimizing the computational overhead associated with real-time graph pathfinding in massive codebases.
Summary updated