Skip to content

Commit

Permalink
Added stop app message in bug hunter and troubleshooter
Browse files Browse the repository at this point in the history
  • Loading branch information
matija-ilijas committed Sep 26, 2024
1 parent 0c3a348 commit 0b2af0c
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 1 deletion.
2 changes: 1 addition & 1 deletion core/agents/bug_hunter.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,9 +108,9 @@ async def check_logs(self, logs_message: str = None):
return AgentResponse.done(self)

async def ask_user_to_test(self, awaiting_bug_reproduction: bool = False, awaiting_user_test: bool = False):
await self.ui.stop_app()
test_instructions = self.current_state.current_iteration["bug_reproduction_description"]
await self.send_message("You can reproduce the bug like this:\n\n" + test_instructions)

await self.ui.send_test_instructions(test_instructions)

if self.current_state.run_command:
Expand Down
1 change: 1 addition & 0 deletions core/agents/troubleshooter.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ async def create_iteration(self) -> AgentResponse:
else:
await self.send_message("Here are instructions on how to test the app:\n\n" + user_instructions)

await self.ui.stop_app()
await self.ui.send_test_instructions(user_instructions)

# Developer sets iteration as "completed" when it generates the step breakdown, so we can't
Expand Down
6 changes: 6 additions & 0 deletions core/ui/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -356,6 +356,12 @@ async def generate_diff(
"""
raise NotImplementedError()

async def stop_app(self):
"""
Stop the App.
"""
raise NotImplementedError()

async def close_diff(self):
"""
Close all diff views.
Expand Down
3 changes: 3 additions & 0 deletions core/ui/console.py
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,9 @@ async def generate_diff(
):
pass

async def stop_app(self):
pass

async def close_diff(self):
pass

Expand Down
5 changes: 5 additions & 0 deletions core/ui/ipc_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ class MessageType(str, Enum):
MODIFIED_FILES = "modifiedFiles"
IMPORTANT_STREAM = "importantStream"
TEST_INSTRUCTIONS = "testInstructions"
STOP_APP = "stopApp"


class Message(BaseModel):
Expand Down Expand Up @@ -460,6 +461,10 @@ async def generate_diff(
},
)

async def stop_app(self):
log.debug("Sending signal to stop the App")
await self._send(MessageType.STOP_APP)

async def close_diff(self):
log.debug("Sending signal to close the generated diff file")
await self._send(MessageType.CLOSE_DIFF)
Expand Down
3 changes: 3 additions & 0 deletions core/ui/virtual.py
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,9 @@ async def generate_diff(
):
pass

async def stop_app(self):
pass

async def close_diff(self):
pass

Expand Down

0 comments on commit 0b2af0c

Please sign in to comment.