diff --git a/server/agent/prompts/issue_helper.py b/server/agent/prompts/issue_helper.py index 2843b89a..eefb4e7d 100644 --- a/server/agent/prompts/issue_helper.py +++ b/server/agent/prompts/issue_helper.py @@ -3,12 +3,13 @@ - Propose a code modification: - Locate the relevant file. - Retrieve its content and generate a *diff* showing the proposed changes. -- Inform users if their request is a new feature and ask them to wait. +- If the issue is a feature request, inform the user that the request has been noted and will be considered. - Respect the language of the issue's title and content. Ensuring that all comments and summarize are given in the same language. e.g., English or Chinese. - Never attempt to create a new issue under any circumstances; instead, express an apology. - If it is needed to use the tool search_issues, the issue_number: {issue_number} should be used as filter_num. - If you don’t have any useful conclusions, use your own knowledge to assist the user as much as possible, but do not fabricate facts. - Avoid making definitive statements like "this is a known bug" unless there is absolute certainty. Such irresponsible assumptions can be misleading. +- If the issue involves market approval or website deployment applications, inform the user that their application will be reviewed by the team and ask them to wait patiently. - At the end of the conversation, be sure to include the following wording and adhere to the language used in previous conversations:
🪧 Tips @@ -20,6 +21,7 @@ repo_name: {repo_name} issue_url: {issue_url} issue_number: {issue_number} +issue_title: {issue_title} issue_content: {issue_content} """ @@ -44,13 +46,18 @@ def generate_issue_prompt( - repo_name: str, issue_url: str, issue_number: str, issue_content: str + repo_name: str, + issue_url: str, + issue_number: str, + issue_title: str, + issue_content: str, ): return ISSUE_PROMPT.format( repo_name=repo_name, issue_url=issue_url, issue_number=issue_number, issue_content=issue_content, + issue_title=issue_title, ) diff --git a/server/agent/prompts/pull_request.py b/server/agent/prompts/pull_request.py index 8d54e90f..78189cdb 100644 --- a/server/agent/prompts/pull_request.py +++ b/server/agent/prompts/pull_request.py @@ -21,6 +21,7 @@ pull_number: {pull_number} title: {title} description: {description} +draft: {draft} ``` ## Task 1: Summarize the Pull Request @@ -58,6 +59,7 @@ # Skip Task Whitelist **SKIP_KEYWORDS**: A list of keywords. If any of these keywords are present in the PR title or description, the corresponding task will be skipped. - Examples: "skip", "ignore", "wip", "merge", "[skip ci]" +- If the draft flag is set to true, the task should be skipped. # Constraints - Strictly avoid commenting on minor style inconsistencies, formatting issues, or changes that do not impact functionality. @@ -119,12 +121,15 @@ """ -def get_role_prompt(repo_name: str, pull_number: int, title: str, description: str): +def get_role_prompt( + repo_name: str, pull_number: int, title: str, description: str, draft: bool +): return PULL_REQUEST_ROLE.format( repo_name=repo_name, pull_number=pull_number, title=title, description=description, + draft=draft, ) diff --git a/server/event_handler/discussion.py b/server/event_handler/discussion.py index caa65fa8..de7cf418 100644 --- a/server/event_handler/discussion.py +++ b/server/event_handler/discussion.py @@ -108,6 +108,7 @@ async def handle_discussion_event(self, action: str): repo_name=repo_name, issue_url=discussion["html_url"], issue_number=discussion["number"], + issue_title=title, issue_content=discussion["body"], ) diff --git a/server/event_handler/issue.py b/server/event_handler/issue.py index e03f3627..8bc1baee 100644 --- a/server/event_handler/issue.py +++ b/server/event_handler/issue.py @@ -50,6 +50,7 @@ async def execute(self): repo_name=repo.full_name, issue_url=issue.url, issue_number=issue.number, + issue_title=issue.title, issue_content=issue.body, ) issue_content = f"{issue.title}: {issue.body}" diff --git a/server/event_handler/pull_request.py b/server/event_handler/pull_request.py index f42eed4b..4eeeabe9 100644 --- a/server/event_handler/pull_request.py +++ b/server/event_handler/pull_request.py @@ -87,7 +87,7 @@ async def execute(self): file_diff = self.get_file_diff(diff) role_prompt = get_role_prompt( - repo.full_name, pr.number, pr.title, pr.body + repo.full_name, pr.number, pr.title, pr.body, pr.draft ) pr_content = f"""