SWE-agent Tutorial: Navigating Repositories and Attempting GitHub Fixes

Matthew Berman sets up a research coding agent, hits an installation problem and a cost limit, then shows an author’s successful SymPy benchmark example.

CaCarlosInvité · SWE-bench
Chaîne
Matthew Berman
Publié
5 avr. 2024
Vidéo
13:59
Lecture
5 min
Diapositives
7
Original
anglais
Ouvrir sur YouTube
En faisant défiler, la vidéo se réduit en bas à droite et continue. Les sous-titres suivent votre langue de lecture.
Langue de lectureDisponible en 2 langues
Cet article n’est pas encore disponible en français ; il s’affiche dans l’original en anglais.
RÉSUMÉ

En 30 secondes

In April 2024, Matthew Berman introduces Princeton’s SWE-agent and its custom tools for browsing, editing, and testing code. He discusses a project-reported SWE-bench comparison, attempts to configure the agent, and runs it on an issue in its own repository. Berman’s local setup fails on his Apple Silicon Mac and his subsequent hosted run stops at its cost limit without a verified fix. A separate author demonstration by Carlos shows an older SymPy benchmark issue passing the demonstrated tests. Historical commands, scores, and product comparisons should not be treated as current documentation or universal success rates.

  1. 1A coding agent for issuesSWE-agent uses language models and repository tools to attempt fixes for software issues.
  2. 2Historical benchmark snapshotThe project chart reports 12.29% for SWE-agent with GPT-4 and 13.84% for Devin, with the latter evaluated on a subset.
  3. 3Agent-computer interfaceThe project describes a linter, a bounded file viewer, directory search, and explicit feedback for empty command output.
  4. 4Installation problemBerman’s Docker setup fails on his Apple Silicon Mac, so he switches to a hosted environment.
  5. 5Run stopped by budgetHis run reaches the configured cost limit; the video does not establish that the issue was solved.
  6. 6A separate author exampleCarlos demonstrates a SymPy matrix issue and reports that the generated patch passes the displayed benchmark tests.

À retenir

  1. SWE-agent gives a language model specialized repository navigation, editing, search, and feedback tools.
  2. The project’s displayed SWE-bench chart reports 12.29% for SWE-agent with GPT-4 and 13.84% for Devin, with Devin evaluated on 25% of the test set.
  3. Berman’s Apple Silicon setup failed, and his later run was interrupted by a cost cap before the fix was verified.
  4. The author’s separate SymPy demonstration reproduces a bug, edits code, reruns the example, and reports passing benchmark tests.
  5. A benchmark percentage is an aggregate for a particular evaluation, not a calibrated probability that an arbitrary issue will be fixed.
  6. The 2024 setup instructions and API prices are historical; provider access and costs depend on current configuration.
TEXTE INTÉGRAL

Lire le texte remanié, chapitre par chapitre

Transcription seule
01

SWE-agent and its benchmark

Berman introduces the Princeton project and discusses its historical SWE-bench chart. The displayed Devin result uses a subset of the test set.

I introduce SWE-agent, a coding-agent project from a Princeton team designed around an agent-computer interface. The goal is to give a language model tools to work on GitHub issues: inspect a repository, try to reproduce a problem, edit files, and produce a proposed fix. These are capabilities the project aims to provide, not a promise that every issue will be solved.

The project’s displayed SWE-bench chart reports 12.29% resolved for SWE-agent using GPT-4 and 13.84% for Devin. Its footnote says the Devin result was evaluated on 25% of the SWE-bench test set. These historical, project-presented results involve different evaluation scopes, so the chart alone cannot establish a universal head-to-head ranking.

Project-reported SWE-bench results
DIAPOSITIVE 1 / 7Project-reported SWE-bench resultsThe chart reports historical scores and notes that Devin was evaluated on 25% of the test set.

The project illustrates an agent reading an issue, reproducing a problem involving conversion to R, searching for relevant files, and editing the likely source. I am impressed by the step-by-step interaction because a model has to find useful parts of a repository rather than receive an entire codebase in one prompt.

The team attributes its results partly to commands and feedback designed for language models. I compare the challenge of finding relevant context in a large repository with tools such as Aider, which I say uses Universal Ctags. The question is how to expose enough useful code without overwhelming the model.

02

Tools designed for the model

The agent-computer interface includes file viewing, search, editing feedback, and a syntax check. Berman considers the challenge of understanding larger repositories.

Agent-computer interface features
DIAPOSITIVE 2 / 7Agent-computer interface featuresThe project lists its linter, file viewer, search command, and empty-output feedback.

The project describes a linter that prevents an edit from proceeding when it introduces syntax errors. Its custom file viewer shows about 100 lines per turn and provides commands for scrolling and searching within a file. I wonder whether a snippet always provides enough context, but the authors report finding this interface useful.

A separate directory-search command returns concise matches, while commands with no output receive an explicit success message. I think of the collection as a small custom development environment for the agent. These interface choices are described by the project; this video does not isolate the effect of each one in an independent experiment.

03

Setting up the environment

Berman walks through Docker, Conda, repository setup, and credentials. His Apple Silicon installation fails, so he continues in a hosted environment.

For the 2024 setup I begin with Docker and Miniconda, clone the repository in a terminal, create the project’s Conda environment from its environment file, activate it, and run the setup script to build a Docker image. These are the steps shown for that version and may differ in later releases.

Docker setup error on Apple Silicon
DIAPOSITIVE 3 / 7Docker setup error on Apple SiliconBerman’s initial local installation fails before he switches environments.

Despite my initial praise for the packaged setup, I cannot get past a Miniconda-related Docker error on my Apple Silicon Mac. I switch to Lightning, which I say is not sponsoring the video, and complete the image build there. The change of environment is a workaround for my demonstration, not proof of the error’s exact cause.

I create a keys configuration file in the project directory and configure a GitHub token and the OpenAI key used for this test. The interface also lists other provider keys as optional. The setup is specific to the version being demonstrated; credentials and provider settings depend on the actual environment.

04

An interrupted issue run

The agent inspects an issue in its own repository and edits code. The run reaches its cost cap before a fix is verified.

I run the agent with a model, a configuration file, and the URL of an issue in the SWE-agent repository itself. The issue concerns a missing `base_commit` record. The agent initializes its environment and starts reading the problem and repository files.

The agent identifies the reported key error and navigates a long file with its built-in viewing commands. It scrolls through several locations before finding the relevant method, then proposes an edit and notices a duplicated setting. I find the sequence interesting, although activity and a proposed patch are not proof of a working solution.

The run reaches its cost cap
DIAPOSITIVE 4 / 7The run reaches its cost capThe console shows the cost limit being exceeded; a successful fix is not demonstrated.

The run stops after exceeding the configured $2 cost limit. I see evidence that the agent made changes, but no completed verification showing that its proposed fix resolves the issue. The project’s aggregate benchmark score cannot be read as the exact probability that this particular issue would be fixed.

I notice that the cost limit can be configured and say I would like to use a local model to avoid the same hosted API charges. At the time I do not find a straightforward local-model option and speculate that future versions might make it easier. Local inference still has hardware and operating costs.

05

An author’s SymPy demonstration

Carlos presents a separate benchmark example, from reproducing a matrix bug through patch submission and displayed test results.

A separate demonstration by an author who introduces himself as Carlos uses a SymPy issue from SWE-bench involving unexpected output from `Matrix.col_insert`. He sends the issue to the agent and then walks through an earlier run of the same example.

Carlos shows the agent creating a reproduction script from the issue and confirming the unexpected behavior. It searches the repository, opens the matrix implementation, and identifies the insertion function as a place to investigate.

Reproducing the SymPy issue
DIAPOSITIVE 5 / 7Reproducing the SymPy issueThe author’s separate demo creates a reproduction script for a matrix insertion problem.

The agent identifies an indexing problem, applies an edit, and reruns the reproduction script. Carlos says the output now matches the expected result. The agent removes the temporary reproduction file and submits a proposed diff for benchmark evaluation.

Applying and checking the patch
DIAPOSITIVE 6 / 7Applying and checking the patchThe demo shows the edited matrix function and reruns the reproduction.
Displayed benchmark test results
DIAPOSITIVE 7 / 7Displayed benchmark test resultsThe author shows passing fail-to-pass and existing test results for this example.

Carlos reports that the submitted patch passes the previously failing test and does not break the existing tests shown in the SWE-bench evaluation. This is one author-selected demonstration, distinct from my interrupted run and from a guarantee about future issues.

Sur la même chaîne

12 diapositives34:21EN
Matthew Berman· 27 oct. 2026Matthew Berman Examines Anthropic’s IPO Filing, AI Growth and GovernanceMatthew Berman, Sam Altman · Forward FutureThe presenter reviews the S-1’s financial metrics, compute strategy and voting structure while questioning the tension between rapid AI development and safety.AnthropicAI SafetyIA en entreprise+2
6 diapositives25:50EN
Matthew Berman· 24 oct. 2026Kimi K3.1 Pro Tested: Strong 3D Demos, Uneven Results and Competitive PricingMatthew Berman · Forward FutureMatthew Berman tests the open-weight model on coding, 3D rendering and visual explanations, then compares benchmark results and prices.Open-weight modelsBenchmarksAI cost & performance+1
2 diapositives32:20EN
Matthew Berman· 23 oct. 2026Who Is Local AI For? The Costs, Trade-offs and a Hybrid FutureMatthew Berman · Forward FutureMatthew Berman weighs data control and independence against hardware cost, setup complexity and inference speed.Local inferenceOpen-weight modelsAI cost & performance+1
6 diapositives1:03:37EN
Matthew Berman· 23 oct. 2026Matthew Berman’s Team Tests Kimi K3.1 on Animation, Games, and ChartsMatthew Berman, Alex, Brian · Forward FutureA live team AMA turns into an informal test of Kimi K3.1, from personal-agent workflows to motion graphics, a browser game, and a benchmark chart.Agents de codeGenerative mediaÉvaluations+2
0:53EN
Matthew Berman· 22 oct. 2026Sam Altman on AI and the Discovery of New KnowledgeSam Altman · OpenAIAltman expects progress in mathematical discovery to extend to biology, materials and energy.AI for scienceMathematicsComputational Biology+1
Diapositives0:22EN
Matthew Berman· 21 oct. 2026A Robot Bodyguard Video Shows Dramatic Rescue ScenariosMatthew Berman · Forward FutureMatthew Berman reacts to a short robot demonstration depicting fighting and vehicle-rescue scenarios.RoboticsÉvaluations