Skip to content

Commit 60ad7b5

Browse files
authored
Merge pull request #66 from commit-0/agent
edit branch name
2 parents ea1bd9e + 1259f3a commit 60ad7b5

File tree

2 files changed

+19
-7
lines changed

2 files changed

+19
-7
lines changed

agent/display.py

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,8 @@ def __init__(self, total_repos: int):
135135
)
136136
self.layout["info"]["other_info"].split_row(
137137
Layout(name="backend", ratio=1),
138-
Layout(name="log_dir", ratio=1),
138+
Layout(name="branch", ratio=2),
139+
Layout(name="log_dir", ratio=2),
139140
)
140141
self.layout["info"]["agent_info"].split_row(
141142
Layout(name="agent_name", ratio=1),
@@ -151,6 +152,10 @@ def __init__(self, total_repos: int):
151152
self.layout["info"]["other_info"]["backend"].update(
152153
Panel(self.backend_display, title="Backend", border_style="blue")
153154
)
155+
self.branch_display = Text("", justify="center")
156+
self.layout["info"]["other_info"]["branch"].update(
157+
Panel(self.branch_display, title="Branch", border_style="blue")
158+
)
154159
self.log_dir_display = Text("", justify="center")
155160
self.layout["info"]["other_info"]["log_dir"].update(
156161
Panel(self.log_dir_display, title="Log Directory", border_style="blue")
@@ -227,9 +232,16 @@ def update_time_display(self, time_in_seconds: int) -> None:
227232
Panel(self.time_display, title="Time Taken", border_style="blue")
228233
)
229234

235+
def update_branch_display(self, branch: str) -> None:
236+
"""Update the branch display with the given branch."""
237+
self.branch_display = Text(f"{branch}", justify="center")
238+
self.layout["info"]["other_info"]["branch"].update(
239+
Panel(self.branch_display, title="Branch", border_style="blue")
240+
)
241+
230242
def update_backend_display(self, backend: str) -> None:
231243
"""Update the backend display with the given backend."""
232-
self.backend_display = Text(f"Backend Using: {backend}", justify="center")
244+
self.backend_display = Text(f"{backend}", justify="center")
233245
self.layout["info"]["other_info"]["backend"].update(
234246
Panel(self.backend_display, title="Backend", border_style="blue")
235247
)

agent/run_agent.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
from datasets import load_dataset
55
from git import Repo
66
from agent.agent_utils import (
7-
args2string,
87
create_branch,
98
get_message,
109
get_target_edit_files,
@@ -48,7 +47,7 @@ def run_agent_for_repo(
4847
agent_config: AgentConfig,
4948
example: RepoInstance,
5049
update_queue: multiprocessing.Queue,
51-
branch: Optional[str] = None,
50+
branch: str,
5251
override_previous_changes: bool = False,
5352
backend: str = "modal",
5453
log_dir: str = str(RUN_AGENT_LOG_DIR.resolve()),
@@ -88,9 +87,9 @@ def run_agent_for_repo(
8887
f"{agent_config.agent_name} is not implemented; please add your implementations in baselines/agents.py."
8988
)
9089

91-
# if branch_name is not provided, create a new branch name based on agent_config
92-
if branch is None:
93-
branch = args2string(agent_config)
90+
# # if branch_name is not provided, create a new branch name based on agent_config
91+
# if branch is None:
92+
# branch = args2string(agent_config)
9493

9594
create_branch(local_repo, branch, example["base_commit"])
9695

@@ -231,6 +230,7 @@ def run_agent(
231230
agent_config.use_spec_info,
232231
agent_config.use_lint_info,
233232
)
233+
display.update_branch_display(branch)
234234
with multiprocessing.Manager() as manager:
235235
update_queue = manager.Queue()
236236
with multiprocessing.Pool(processes=max_parallel_repos) as pool:

0 commit comments

Comments
 (0)