A Jagged Frontier: Evaluating Robustness of Code Agents to Semantics-Preserving Transformations
Organizations: Colorado State University · Microsoft · University of Illinois Urbana-Champaign · Carnegie Mellon University
Abstract
AI code agents are increasingly deployed to resolve real software issues, yet their reliability under superficial code variations remains poorly understood. We evaluate whether coding agents that repair repository-level issues remain reliable when the surrounding codebase is rewritten into a semantically equivalent form. We introduce a random variant sampler that applies common semantics-preserving transformations (SPTs) - spanning control-flow rewrites, dead-code injection, and identifier renaming - to produce perturbed variants. We evaluate two agentic scaffolds (mini-SWE agent and OpenCode) each backed by one of four frontier models (Claude Opus 4.5, Kimi K2.5, MiniMax M2.5, and Qwen 3.6-27B) across instances drawn from SWE-bench Verified and SWE-bench Pro. For each instance, the agent is run multiple times on the unperturbed and perturbed variants, yielding paired resolve-rate estimates that isolate the perturbation effect from intrinsic stochasticity. We find small degradation in most configurations: up to 6.7 percentage points mean resolve-rate drop in the most affected configurations with statistically significant degradations in 6 of 16 configurations of model, scaffold, and dataset. Crucially, no single model ranking by robustness holds across scaffolds - Qwen is among the most robust under mini-SWE agent on SWE-bench Verified yet the most brittle under OpenCode - revealing a jagged robustness frontier. The simpler scaffold (mini-SWE agent) is more robust to perturbation. Our results demonstrate that even top frontier models are susceptible to semantics-preserving perturbations although the effect is not uniform, raising concerns about the deployment reliability of AI code agents in diverse real-world codebases.
Figures & tables
| Transformation | Summary |
|---|---|
| If Else Switcher | Swaps if/else branches and negates the condition |
| For Loop Rewriting | Rewrites a for loop using an explicit iterator |
| And Condition Splitter | Decomposes if A and B into nested if s |
| Comparison Swapper | Swaps operands and inverts the operator |
| While Loop Unrolling | Unrolls one iteration of a while loop |
| Double Negation Injector | Wraps a condition in not not ( ) |
| Category | mini-SWE | OpenCode |
|---|---|---|
| Architecture | Single, centralized agent | Primary agents invoke tools and subagents for specific tasks (e.g., Build, Plan, General, Explore) |
| Available Tools | bash | bash , edit , write , read , grep , glob , lsp , apply_patch , skill , todo_write , web_fetch , web_search , question |
| Access Restrictions | None | Available tools determined by an agent’s role and user configuration |
| Context Management | Continuous, append-only | Multiple, dynamically changing contexts for different subagents |
AI Coding Agents
AI coding agents use language models and software tools to plan, edit, test, and maintain code with varying levels of autonomy.
See all 327 papers