Skip to content
BIASED

Coding agents

Repository, ACI, SWE-bench, and test verification under a step budget.

Why code is a good environment

Earlier notes built the loop, tools, memory, plans, reflection and the choice of fixed workflow versus open agent. Software is where those pieces went furthest: an agent gets an issue, reads and edits a repo, runs commands, and stops when it believes the change is done. The reason keeps returning — tests are a judge the model’s words cannot fake.

The one-shot baseline — BM25-retrieve files, write a unified diff, never execute — almost never works: Claude 2 resolved 1.96% of 2 294 SWE-bench tasks (2023); GPT-4 Turbo under the same setup 1.31% (2024). Retrieval misses the right files; blind diffs fail to apply; nothing tells the model the fix is wrong. Each failure points to a loop: search until the place is found, edit through a checked interface, run the code.

SWE-bench

A coding environment is a repository (partially observable views), a shell (any developer command), and tests (the verdict). A typical episode: localize → reproduce the failing example → edit via an interface that checks the change → test visible suites → submit patch δ\delta → grade on hidden tests.

SWE-bench builds tasks from real GitHub issues and resolving PRs. FAIL_TO_PASS tests fail on RR and pass on R⊕δ⋆R\oplus\delta^\star; PASS_TO_PASS stay green on both. A candidate resolves the task only if

resolved⁡(δ)=∏τ∈TF2P∪TP2P1[τ passes on R⊕δ].\operatorname{resolved}(\delta)=\prod_{\tau\in T_{\mathrm{F2P}}\cup T_{\mathrm{P2P}}}\mathbf{1}[\tau\text{ passes on }R\oplus\delta].

A patch that fixes the bug and breaks one unrelated test resolves nothing. Verified (500 human-screened tasks) became the headline for ~18 months, then saturated and was retired as a vendor headline in early 2026 after audits of flawed tests and contamination — the general lesson that public sets drift into training data (Evaluating agents).

Agent–computer interface

Key idea. A coding agent is limited less by what the model knows than by what it sees and how actions fail. Design the agent–computer interface (ACI) for the model: short structured observations, actions that check themselves and fail loudly, and a test the agent can run.

SWE-agent replaced raw cat/sed/grep -r with a 100-line windowed viewer, summarised search, an edit that lints and rejects syntax errors, and history collapsed to the last five observations. On Lite with GPT-4 Turbo (2024): full ACI 18.0%; edit without linter 15.0%; shell-only 10.3%; every search hit 12.0%; full file 12.7%. Showing more is not better. Later strong systems used an even simpler shell + exact str_replace editor that fails when the old string is not found exactly once — the same loud-failure principle (Claude 3.5 Sonnet ~49% Verified, Oct 2024).

Agentless and three stages

When steps are predictable, fix them in code. Agentless (Xia et al., 2024): hierarchical localization (file tree → skeletons → lines) → sample search-and-replace patches → generate reproduction tests, run them with existing tests, majority-vote among survivors. With GPT-4o: 32% Lite, 33.2% Verified, ~$0.70/task — a strong workflow baseline. Open agents still win when the cause is far from the symptom, a new file is needed, or only a live command reveals the failure.

Three stages, three failure modes: localization (most common — wrong function can pass weak own tests); editing (whole-file rewrite vs fragile unified diffs vs exact search-and-replace); verification (the only judge at test time is tests the agent can run).

Verification and budget

Under step budget BB, suppose each proposed fix is correct with probability cc, wrong but passing visible tests with hh, and caught otherwise. Submitting the first edit succeeds with cc. Testing and retrying until accept yields, with unlimited budget,

p=cc+h.p=\frac{c}{c+h}.

With c=3/8c=3/8, h=1/8h=1/8, verification doubles 0.375→0.75 — but at small BB the testing agent can resolve fewer tasks than one-shot because reproduction and runs consume steps (toy: ~0.612 at B=10B=10, ~0.747 at B=20B=20). A score without budget, model, scaffold, split and date is not comparable. Sampling NN candidates and selecting with tests is the same generate-and-verify arithmetic.

Sandbox and next

The agent runs model-written code inside someone else’s repo with model-chosen commands. Sandbox: container per task (namespaces, cgroups, disposable image), unprivileged user, network off unless needed, time limits. A container shares the host kernel; VMs add a stronger boundary at scale. Sandboxing protects the host, not the task from bad patches inside, nor the agent from injected instructions in files (Agent security).

Scores moved from ~2% (2023 retrieval) to most of Verified (2025) via models, ACIs, verification and RL — until the benchmark’s own flaws capped it. Next environment: screens and clicks without a disposable test oracle — web and computer-use agents.

Check your understanding

The same questions as in Pulse. Answers are shared between modes.

Full notes

Answers are saved on the server and tied to this browser until you sign in.