From 07d40e2c053283c83f367eda850fdab9e59b0ef1 Mon Sep 17 00:00:00 2001 From: Benedict Lee Date: Mon, 6 Jan 2025 12:42:12 +0900 Subject: [PATCH] fix : support ai title with markers --- pr_agent/tools/pr_description.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/pr_agent/tools/pr_description.py b/pr_agent/tools/pr_description.py index 7744b699..62c36b01 100644 --- a/pr_agent/tools/pr_description.py +++ b/pr_agent/tools/pr_description.py @@ -471,7 +471,16 @@ class PRDescription: def _prepare_pr_answer_with_markers(self) -> Tuple[str, str, str, List[dict]]: get_logger().info(f"Using description marker replacements {self.pr_id}") - title = self.vars["title"] + + # Remove the 'PR Title' key from the dictionary + ai_title = self.data.pop('title', self.vars["title"]) + if (not get_settings().pr_description.generate_ai_title): + # Assign the original PR title to the 'title' variable + title = self.vars["title"] + else: + # Assign the value of the 'PR Title' key to 'title' variable + title = ai_title + body = self.user_description if get_settings().pr_description.include_generated_by_header: ai_header = f"### 🤖 Generated by PR Agent at {self.git_provider.last_commit_id.sha}\n\n"