mlsanityData to 24 Nov 2026

Metrics-in-the-Loop: Complexity Feedback Reshapes Agent-Written Code

arXiv 2611.23817 ↗Submitted 18 Nov 2026Announced 19 Nov 2026cs.AIcited by 0

On the map: LLM agents and tool use → Software engineering coding agents

Abstract (arXiv)

Coding agents now write whole codebases in long autonomous runs, guided mainly by whether their tests pass. Yet passing tests alone does not reveal accumulating complexity or gaps in test coverage, which then persist as agents extend their own code. We introduce metrics-in-the-loop, an inference-time intervention that gives agents in-flight feedback: cheap, automatically computed code metrics injected into the agent's context during the trajectory. After each code-changing agent turn, we insert short feedback messages naming changed functions whose cyclomatic complexity exceeds a limit (complexity feedback) or changed lines that are skipped by tests (coverage feedback), giving the agent the opportunity to refactor code or strengthen tests before continuing. We run extensive experiments and ablations comparing several interventions across three long-horizon coding benchmarks and four strong models. We find that complexity feedback significantly reduces erosion, a measure of complexity concentration of code, without affecting held-out correctness of the code. Broadly, our experiments investigate a practical form of agent "re-railing", where timely, actionable measurements redirect agents before weaknesses become the foundation they keep building on. As agents scale to codebases with millions of lines, such interventions become critical to sustaining effective development and long-term code maintainability.

Key facts. No citing papers in the map yet (data through 24 Nov 2026). Placed in Software engineering coding agents, one of 16 directions in LLM agents and tool use. Builds on 8 of its 27 references that are in the map. Submitted 18 Nov 2026, announced 19 Nov 2026.

Builds on

8 of 27 references.

Closest ancestors · 3

Same direction, newest first

  1. 2026Does Code Cleanliness Affect Coding Agents? A Controlled Minimal-Pair Study19 May
  2. 2026SlopCodeBench: Benchmarking How Coding Agents Degrade Over Long-Horizon Iterative Tasks25 Mar
  3. 2025SWE-EVO: Benchmarking Coding Agents in Long-Horizon Software Evolution Scenarios20 Dec

Other references · 5

  1. 2024Adding Error Bars to Evals: A Statistical Approach to Language Model Evaluationscited by 203
  2. 2018Categorizing Variants of Goodhart's Lawcited by 175
  3. 2026ProgramBench: Can Language Models Rebuild Programs From Scratch?cited by 81
  4. 2024Commit0: Library Generation from Scratchcited by 62
  5. 2016Small sample methods for cluster-robust variance estimation and hypothesis testing in fixed effects modelscited by 9

Built on by

Not cited yet.

Similar, not cited

Close in wording, no citation either way

  1. 2026EvoCode-Bench: Evaluating Coding Agents in Multi-Turn Iterative Interactions
  2. 2026Latent Programming Horizons in Coding Agents
  3. 2026LoopsBench: From Harness Engineering to Loop Engineering in Coding Agent Evaluation
  4. 2026Interpreting Coding Agents Through Their Behavioral Trajectories
  5. 2026SWE-Duel: Towards a Self-Scaling Arena for Coding Agents
  6. 2026When the Specification Emerges: Benchmarking Faithfulness Loss in Long-Horizon Coding Agents
  7. 2026How Generation Architecture Shapes Code Complexity in Multi-Agent LLM Systems: A Paired Study on HumanEval
  8. 2026Beyond Resolution Rates: Behavioral Drivers of Coding Agent Success and Failure