SWE-agent takes a GitHub issue and tries to automatically fix it, using GPT-4, or your LM of choice. It solves 12.47% of bugs in the SWE-bench evaluation set and takes just 1 minute to run.
What does this implement/fix? Explain your changes.
Adds a "filemap" command to aid in exploring large files/codebase and avoid scroll_down-hell. For example,
$ filemap SWE-agent/sweagent/agent/agents.py
...
239 class Agent:
240 """Agent handles the behaviour of the model and how it interacts with the environment."""
241
242 def __init__(self, name: str, args: AgentArguments):
243 ... eliding lines 243-256 ...
257
258 def add_hook(self, hook: AgentHook):
259 """Add hook to agent"""
260 hook.on_init()
261 self.hooks.append(hook)
262
263 def _append_history(self, item: dict):
264 for hook in self.hooks:
265 hook.on_query_message_added(**item)
266 self.history.append(item)
267
268 def setup(self, instance_args, init_model_stats=None) -> None:
269 ... eliding lines 269-322 ...
...
It is currently designed to elide any function or method definition that is at least 5 lines long. Changing this setting is straightforward.
There is currently no special handling for docstrings. If a function has a docstring it will be elided by default (unless the entire function body is less than 5 lines long).
Remaining TODOs:
[x] ~I have not verified that this command works within the SWE-agent docker environment, and I am not yet sure what the right approach is to test this.~ done
The easiest way to test this is to just do py run.py ... --model human and then you can type commands instead of the AI. So you could try what filemap does with some of the issues
Reference Issues/PRs
n/a
What does this implement/fix? Explain your changes.
Adds a "filemap" command to aid in exploring large files/codebase and avoid
scroll_down
-hell. For example,It is currently designed to elide any function or method definition that is at least 5 lines long. Changing this setting is straightforward.
There is currently no special handling for docstrings. If a function has a docstring it will be elided by default (unless the entire function body is less than 5 lines long).
Remaining TODOs: