Coding and Software-Engineering Agents › What makes software a good environment for agents

Michael BrenndoerferDecember 1, 20264 min read
Language AI HandbookAll chapters
Part 49 of 67Long-Horizon Agents and Interoperability
Chapter 374Coding and Software-Engineering Agents › What makes software a good environment for agents
Reading section 2 of 12 · What makes software a good environment for agents · 4 minSection 2 of 12 · 4 min

Section 2 of 12 · 4 min read

Reading settings

Definitions

Choose how many terms have tooltips.

Article links

Make inline references clickable

Notes & comments

Before we look at the loop, it is worth understanding why this domain rewards agentic treatment more than, say, open-ended question answering. The answer comes down to four properties, and each one shapes how we design the system.

A test runner records whether its assertions held for the cases it executed. A failed test can identify the expected output, the observed output, or an exception. The cost depends on the suite and what the environment has to start or install.

Verification can have different unit costs. The first figure compares two assumed unit costs under the same modeled budgets. A local test result and a human judgment answer different questions, so the example isolates the cost calculation.

PythonIn [3]
CollapseExpand
# Cost per verification sample, in USD. Order-of-magnitude estimates for
# illustration: a human rater's attention for one judgment vs. one cheap
# local subprocess test run.
cost_human_rater = 1.0
cost_subprocess = 0.0005
budgets = [10.0, 100.0, 1000.0]
budget_trials = {
    "human rater": [b / cost_human_rater for b in budgets],
    "test runner": [b / cost_subprocess for b in budgets],
}
for b in budgets:
    print(
        f"budget=${b:>7.0f}: human={b / cost_human_rater:>9.0f}  tests={b / cost_subprocess:>9.0f}"
    )
print("ratio (tests per human sample):", cost_human_rater / cost_subprocess)
ConsoleOut [3]
CollapseExpand
budget=$     10: human=       10  tests=    20000
budget=$    100: human=      100  tests=   200000
budget=$   1000: human=     1000  tests=  2000000
ratio (tests per human sample): 2000.0

The assumed costs give 2,000 test runs per human judgment at a fixed budget. Use measured costs for your own test suite and include the judgments it cannot replace.

VisualizationOut [4]
CollapseExpand
Bar chart of affordable trials by budget for human versus test feedback
Modeled trials under three budgets on a log scale. At the assumed 1 USD per human judgment and 0.0005 USD per test run, a budget buys 2,000 times as many test runs. The two feedback types answer different questions.

The second is composability of context. A repository is a structured corpus. Files import other files, functions call other functions, and tests reference the exact symbols under test. An agent with the right search tools can navigate this structure deliberately, jumping from a failing test to the function it exercises to the helper that function depends on, rather than being handed a fixed context window of code and hoping the relevant part is inside it. This is a very different problem from the "stuff everything into the prompt" approach, and it is why repository navigation is a first-class skill. The graph structure of imports and calls also means the agent can follow edges rather than guessing: from a failing assertion it can traverse to the definition, then to the callee that returned the wrong value, then to the constant that was misconfigured, each hop a principled step instead of a leap of faith.

A small, well-scoped diff is easier to review. For a localized behavior change, record which files changed and inspect how the modified code relates to its callers. Larger changes may still be necessary when the required behavior crosses a module boundary.

The fourth is auditability. A version-control diff records tracked content changes. If you also want to reconstruct how an agent reached the patch, retain the tools it called, their outcomes, and the model and resource settings used to make the decisions.

Verification is not correctness

Passing tests support the behavior they exercise. The evidence weakens if the proposed change can alter the verifier or make an overly narrow case pass.

HumanEval checks generated standalone Python functions against unit tests. Repository-level evaluations also ask the system to locate and change existing code, where compatibility with callers and the supplied checkout matters.

Give an agent the existing specification and the test result first. Repository search reveals where the implementation lives and which callers could be affected.

Comments

Add to the conversation

A question, a correction, or an example from your own work.

No comments yet. Be the first to share your thoughts!

Newsletter

Stay up to date

Get new articles, book updates, and notes on AI and technology.

Unsubscribe at any time. Privacy policy