TL;DR: A coding agent is the ordinary loop with tools for a repository: search, read, edit, run commands. It starts from a small map of the repository and its instruction file, not from the code itself. It searches for the failing test and the code it exercises, reads slices of those files, proposes an edit as a patch the harness applies, and runs the tests. The test output comes back as an observation, so a failure is the next input rather than the end. The run ends when the tests pass, when a budget runs out, or when the harness decides the agent is going in circles. The commit and pull request are made by the harness from the diff, with the trace attached.
How to approach it
Narrate one run from the task to the pull request, as steps with tool calls. Point out the two places where the design decides the outcome: how the agent finds the right code without reading the whole repository, and how it knows an edit worked. Then say what the harness owns: the sandbox the commands run in, the budgets, and the pull request itself.
A strong answer
The task arrives with a repository and a failing test. The agent's first problem is that the repository is far larger than any context, so it does not read the code; it reads a map (Repository Context):
step 0 harness builds the context
- the directory outline with each file's main classes and functions
- the repository's instruction file: how to build, test, conventions
- the task: "test_half_even in tests/test_rounding.py fails"
step 1 model -> run_tests(path="tests/test_rounding.py")
observe: 1 failed. expected 2.50, got 2.51 at rounding.py:14
step 2 model -> search(pattern="def round_half_even")
observe: billing/rounding.py:9
step 3 model -> read(file="billing/rounding.py", lines=1-40)
observe: the function, which rounds half up
step 4 model -> edit(file="billing/rounding.py", patch=<diff>)
harness applies the patch; observe: applied, 3 lines changed
step 5 model -> run_tests(path="tests/")
observe: 48 passed
step 6 model -> text "Fixed: round_half_even used half-up rounding."
stop_reason = natural end
Three things in that trace carry the design. First, the agent found the code by search, exact search for a name it learned from the test output, rather than by reading. A repository map plus search is what keeps the context on the code the task touches; agents that read directory after directory run out of budget before editing anything. Second, the edit is a patch the harness applies, not a file the model rewrites. A patch is reviewable, small, and fails loudly when the model's idea of the file has drifted from the real one. Third, the test run is the check. The agent does not know its edit worked because it believes so; it knows because the harness ran the tests and returned the output. When the output is a failure, it is the next observation and the loop continues.
The loop has the same risks as any agent, with the repository's own flavour. The agent can edit the test instead of the code so the check passes, which is why the trajectory is graded and the diff is reviewed, not only the test result. It can go in circles, reading the same file and running the same tests without editing, which the harness catches with a loop detector and a step budget. And it can run commands the task did not need, which is why everything in that trace executes inside a sandbox with the repository mounted and the network closed except for what the build needs.
When the loop ends with passing tests, the harness, not the model, makes the artefact. It takes the diff from the workspace, runs the formatter and the full suite once more, creates the commit with the task reference, and opens the pull request with a description the model wrote and the trace linked. A person reviews the diff the same way they would review a colleague's, with the extra question of whether the agent changed what it was asked to change.
Authority line: the model chooses what to search, read and edit; the harness decides which commands may run, applies the patches, runs the checks, enforces the budgets and owns the commit. Nothing the model wrote reaches the main branch without the harness's checks and a person's review.
What interviewers probe next
"The agent made the test pass by changing the assertion." The test result is necessary and not sufficient. Grade the diff: did it touch files outside the scope, did it change the test it was asked to fix. Make tests read-only for the agent when the task is to fix the code, and review the diff before merging.
"The repository has forty thousand files. Does the map still fit?" Not as a flat outline. Rank the map by relevance to the task, from the files the task names and what they reference, and fill a fixed budget with the top entries. The agent searches for the rest.
"Why a patch rather than rewriting the file?" The model's copy of the file is from the turn it read it; a rewrite overwrites changes it did not see and spends tokens on unchanged lines. A patch against the current file fails if the context moved, and that failure is useful.
How it's scored
Weak: Describes the agent as "the model reads the code and fixes it", with no map, no check and no harness.
Hire: Narrates the run as a trace with a map, search, slice reads, a patch and a test run as the check, and ends the loop on passing tests or a budget.
Strong Hire: Also names editing the test as the failure to grade for, puts commands in a sandbox, keeps the commit and pull request with the harness, and explains why patches beat rewrites.
Common mistakes
- Loading the repository into the context instead of a map and search.
- Trusting the model's statement that the fix works instead of running the tests.
- Letting the agent edit the tests that define the task.
- Rewriting whole files and losing changes the model never saw.
- Running the agent's commands with the developer's own credentials and network.