SCAgent : An LLM ‐Based Agent With State‐Aware Coordination for Automated Program Repair
Automated program repair (APR) has emerged as a promising technique for improving software reliability by automatically fixing bugs. Recent advances in large language models (LLMs), particularly LLM‐based agents, have further enhanced repair capabilities by enabling flexible patch generation and iterative reasoning. However, existing LLM‐based agent frameworks still suffer from several limitations, including unstructured repair processes, unproductive trial‐and‐error loops and the lack of explicit coordination between reasoning and action, which lead to inefficient and unstable repair behaviours. In this paper, we propose SCAgent, an LLM‐based agent for APR with state‐aware coordination. SCAgent structures the repair process into coordinated stages, including bug understanding, information gathering and patch generation, and dynamically controls transitions between these stages based on the repair context. Experimental results on Defects4J show that SCAgent correctly repairs 173 bugs. We further conduct a preliminary evaluation on GitBug‐Java to assess its potential generalizability, with SCAgent correctly repairing 15 bugs in a sampled subset of 100 bugs.