From d83ecf380340ca37c442a0470ee9dae8eef3499c Mon Sep 17 00:00:00 2001 From: Zvonimir Sabljic Date: Sun, 11 Aug 2024 20:33:33 -0700 Subject: [PATCH] init fix --- core/agents/code_monkey.py | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/core/agents/code_monkey.py b/core/agents/code_monkey.py index 710da8dc..ad50ea14 100644 --- a/core/agents/code_monkey.py +++ b/core/agents/code_monkey.py @@ -62,8 +62,18 @@ class CodeMonkey(BaseAgent): instructions = task.get("task_review_feedback") elif iterations: last_iteration = iterations[-1] - instructions = last_iteration.get("description") - user_feedback = last_iteration.get("user_feedback") + user_feedback = None + + if len(last_iteration["bug_hunting_cycles"]) > 0: + instructions = last_iteration["bug_hunting_cycles"][-1]["human_readable_instructions"] + user_feedback = last_iteration["bug_hunting_cycles"][-1]["user_feedback"] + else: + instructions = last_iteration.get("description") + + if user_feedback is None: + user_feedback = last_iteration.get("user_feedback") + + # TODO: remove this or update once we add back QnA with the user user_feedback_qa = last_iteration.get("user_feedback_qa") else: instructions = self.current_state.current_task["instructions"]