Skip to content

Commit 9e62266

Browse files
committed
update code for better test
1 parent e8d1edb commit 9e62266

File tree

3 files changed

+11
-1
lines changed

3 files changed

+11
-1
lines changed

agent/agents.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ def run(
6262
lint_cmd: str,
6363
fnames: list[str],
6464
log_dir: Path,
65+
test_first: bool = False,
6566
) -> AgentReturn:
6667
"""Start aider agent"""
6768
if test_cmd:
@@ -111,7 +112,14 @@ def run(
111112
coder.stream = True
112113

113114
# Run the agent
114-
coder.run(message)
115+
if test_first:
116+
test_errors = coder.commands.cmd_test(test_cmd)
117+
if test_errors:
118+
coder.run(test_errors)
119+
else:
120+
coder.run(message)
121+
122+
# #### TMP
115123

116124
# #### TMP
117125
# import time

agent/run_agent.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,7 @@ def run_agent_for_repo(
139139
lint_cmd,
140140
target_edit_files,
141141
test_log_dir,
142+
test_first=True,
142143
)
143144
# after running the agent, update the money display
144145
update_queue.put(

agent/run_agent_no_rich.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,7 @@ def run_agent_for_repo(
130130
lint_cmd,
131131
target_edit_files,
132132
test_log_dir,
133+
test_first=True,
133134
)
134135
# cost = agent_return.last_cost
135136
else:

0 commit comments

Comments
 (0)