You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: agent/README.md
+67-33Lines changed: 67 additions & 33 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,39 +1,73 @@
1
-
# How to run baseline
1
+
# Agent for Commit0
2
+
This tool provides a command-line interface for configuring and running AI agents to assist with code development and testing.
2
3
3
-
Step 1: Go to `config/aider.yaml` and change the config
4
+
## Quick Start
5
+
Configure an agent:
6
+
```bash
7
+
agent config [OPTIONS] AGENT_NAME
8
+
```
4
9
5
-
Step 2: Run the following command
10
+
Run an agent on a specific branch:
11
+
```bash
12
+
agent run [OPTIONS] BRANCH
13
+
```
6
14
15
+
For more detailed information on available commands and options:
7
16
```bash
8
-
python baselines/run_aider.py
17
+
agent -h
18
+
agent config -h
19
+
agent run -h
9
20
```
21
+
## Configure an Agent
22
+
Use `agent config [OPTIONS] AGENT_NAME` to set up the configuration for an agent.
23
+
Available options include:
24
+
25
+
`--agent_name: str`: Agent to use, we only support [aider](https://aider.chat/) for now. [Default: `aider`]
26
+
`--model-name: str`: LLM model to use, check [here](https://aider.chat/docs/llms.html) for all supported models. [Default: `claude-3-5-sonnet-20240620`]
27
+
`--use-user-prompt: bool`: Use a custom prompt instead of the default prompt. [Default: `False`]
28
+
`--user-prompt: str`: The prompt sent to agent. [Default: See code for details.]
29
+
`--run-tests: bool`: Run tests after code modifications for feedback. You need to set up `docker` or `modal` before running tests, refer to commit0 docs. [Default `False`]
30
+
`--max-iteration: int`: Maximum number of agent iterations. [Default: `3`]
31
+
`--use-repo-info: bool`: Include the repository information. [Default: `False`]
32
+
`--max-repo-info-length: int`: Maximum length of the repository information to use. [Default: `10000`]
33
+
`--use-unit-tests-info: bool`: Include the unit tests information. [Default: `False`]
34
+
`--max-unit-tests-info-length: int`: Maximum length of the unit tests information to use. [Default: `10000`]
35
+
`--use-spec-info: bool`: Include the spec information. [Default: `False`]
36
+
`--max-spec-info-length: int`: Maximum length of the spec information to use. [Default: `10000`]
37
+
`--use-lint-info: bool`: Include the lint information. [Default: `False`]
38
+
`--max-lint-info-length: int`: Maximum length of the lint information to use. [Default: `10000`]
39
+
`--pre-commit-config-path: str`: Path to the pre-commit config file. This is needed for running `lint`. [Default: `.pre-commit-config.yaml`]
40
+
`--agent-config-file: str`: Path to write the agent config. [Default: `.agent.yaml`]
41
+
42
+
## Running Agent
43
+
Use `agent run [OPTIONS] BRANCH` to execute an agent on a specific branch.
44
+
Available options include:
45
+
46
+
`--branch: str`: Branch to run the agent on, you can specific the name of the branch
47
+
`--backend: str`: Test backend to run the agent on, ignore this option if you are not adding `run_tests` option to agent. [Default: `modal`]
48
+
`--log-dir: str`: Log directory to store the logs. [Default: `logs/aider`]
49
+
`--max-parallel-repos: int`: Maximum number of repositories for agent to run in parallel. Running in sequential if set to 1. [Default: `1`]
50
+
`--display-repo-progress-num: int`: Number of repo progress displayed when running. [Default: `5`]
51
+
52
+
53
+
### Example: Running aider
54
+
Step 1: Configure aider: `agent config aider`
55
+
Step 2: Run aider on a branch: `agent run aider_branch`
56
+
57
+
### Other Agent:
58
+
Refer to `class Agents` in `agent/agents.py`. You can design your own agent by inheriting `Agents` class and implement the `run` method.
59
+
60
+
## Notes
61
+
62
+
### Automatically retry
63
+
Aider automatically retries certain API errors. For details, see [here](https://github.com/paul-gauthier/aider/blob/75e1d519da9b328b0eca8a73ee27278f1289eadb/aider/sendchat.py#L17).
64
+
65
+
### Parallelize agent running
66
+
When increasing --max-parallel-repos, be mindful of aider's [60-second retry timeout](https://github.com/paul-gauthier/aider/blob/75e1d519da9b328b0eca8a73ee27278f1289eadb/aider/sendchat.py#L39). Set this value according to your API tier to avoid RateLimitErrors stopping processes.
67
+
68
+
### Large files in repo
69
+
Currently, agent will skip file with more than 1500 lines. See `agent/agent_utils.py#L199` for details.
70
+
71
+
### Cost
72
+
Running a full `all` commit0 split costs approximately $100.
0 commit comments