TL;DR
Current AI coding benchmarks evaluate agents in a vacuum, resetting the repository to a clean state for every single issue. This paper introduces ChainSWE, the first benchmark that tests agents on chronological sequences of dependent bugs within a single, evolving codebase. The evaluation reveals that as errors compound across a chain, agent performance drops by up to 70%, highlighting a massive gap between single-issue resolution and real-world software maintenance.
What Problem Does This Paper Address?
In the real world, software engineers rarely work on isolated, self-contained tasks. Instead, they maintain codebases over long horizons, fixing a stream of related defects where the changes made for one fix directly impact the starting state of the next.
However, existing software engineering (SWE) benchmarks evaluate models one bug at a time: the repository is reset, the codebase is re-read, and a single issue is graded in isolation. This protocol completely misses two critical real-world failure modes that occur when state carries over:
- Overshoot: An agent fixes an early bug but unnecessarily modifies extra files, polluting the baseline and causing downstream fixes to fail.
- Undershoot: An agent fixes a bug but skips necessary multi-file refactors or preconditions, causing downstream tests to fail because the codebase's structural requirements were never fully established.
To bridge this gap, the authors introduce a framework to evaluate how well language model (LM) agents manage context and avoid error propagation across sequential, dependent bug fixes.
Methods
The authors evaluate seven state-of-the-art LMs using a fixed agent scaffold (SWE-EDIT) across three distinct evaluation modes designed to isolate the impact of repository state versus conversation memory:
- ORACLE: The standard isolated baseline where the container is reset for each bug, but perfect "gold patches" from previous steps are pre-applied.
- SEQ (Sequential): The agent fixes bugs chronologically in a single container without resets. The agent's conversation history is refreshed between bugs, meaning it must adapt purely to the self-generated repository state left behind by its previous edits.
- SEQ+MEM (Sequential + Memory): Identical to SEQ, but the agent's full conversation history (including intermediate observations and dead ends) is preserved across bugs.
They also test these modes under three context-management configurations: BASELINE (retaining the full raw interaction transcript), SUMMARIZE (compressing history with an LLM-generated summary after 50K tokens), and SUB-AGENT (delegating file edits to a secondary, smaller editor model).
Datasets
The authors constructed the ChainSWE dataset by mining chronological chains of issues from six existing repository-level benchmarks (including SWE-bench, SWE-bench Live, and SWE-rebench).
They used Abstract Syntax Tree (AST) parsing on git diffs to ensure that consecutive bugs had explicit code overlap (shared files, functions, or classes) and validated the chains via containerized test re-execution. The final dataset contains 100 bug chains comprising 304 total instances across 54 unique Python repositories.
Key Insights and Ideas
- Later bugs aren't harder; the state just gets messier: Under the ORACLE mode (where prior states are perfectly restored), agent performance actually stays flat or improves on later bugs in a chain. The steep performance drops seen in sequential modes are entirely driven by compounded errors and state drift, not intrinsic task difficulty.
- Active context rewriting backfires: Counterintuitively, active context compaction strategies like SUMMARIZE and SUB-AGENT degraded performance compared to simply retaining the raw history (BASELINE). Active rewriting introduces information loss and inconsistencies that accelerate sequential degradation.
- Baking in destruction: The most common chain error (40%) was "breaking working code," where an agent's downstream patch interacted poorly with its own prior corrupted edits. Because this structural damage is already baked into the codebase, providing the model with a longer conversation memory (SEQ+MEM) rarely helps.
Key Results
- Sharp Performance Drops: Moving from isolated fixes (ORACLE) to sequential fixes (SEQ) caused average per-bug accuracy across all models to plummet from 58.9% to 36.5% (a ~38% relative decline).
- Compounding Difficulty: At the deepest position in the chain (Position 3), the performance gap widened significantly, showing up to a 70% relative performance drop for some configurations.
- Model Robustness: GPT-5.5 proved to be the most robust model under the raw-history baseline (suffering a 29% drop) and was the only model that successfully leveraged conversation memory (SEQ+MEM) to mitigate repository state drift. Other models saw no measurable benefit from carrying conversation history forward.
Limitations and Future Work
- Language and Scale Constraints: The benchmark is currently restricted to Python projects. Furthermore, because long, contiguous issue sequences are rare in existing source datasets, the maximum chain length is capped at 5 instances.
- Noisy Benchmarks: A small portion of failures stem from hidden test requirements or noisy instances inherited from the underlying source benchmarks rather than actual agent errors.
- Future Directions: The authors emphasize that future SWE agent research must shift focus away from single-shot code generation and toward dependency-aware reasoning, long-horizon planning, and robust repository-state management.
Summary updated