Skip to content

Commit c551583

Browse files
authored
making summarize tool explicitly mention the authors of comments and summarize all the comments (#6389)
1 parent 2a80247 commit c551583

2 files changed

Lines changed: 5 additions & 2 deletions

File tree

src/lm/tools/fetchIssueTool.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ export interface FetchIssueResult {
2626
title: string;
2727
body: string;
2828
comments: {
29+
author: string;
2930
body: string;
3031
}[];
3132
fileChanges?: FileChange[];
@@ -43,7 +44,7 @@ export class FetchIssueTool extends RepoToolBase<FetchIssueToolParameters> {
4344
const result: FetchIssueResult = {
4445
title: issueOrPullRequest.title,
4546
body: issueOrPullRequest.body,
46-
comments: issueOrPullRequest.item.comments?.map(c => ({ body: c.body })) ?? []
47+
comments: issueOrPullRequest.item.comments?.map(c => ({ body: c.body, author: c.author.login })) ?? []
4748
};
4849
if (issueOrPullRequest instanceof PullRequestModel) {
4950
const fileChanges = await issueOrPullRequest.getFileChangesInfo();

src/lm/tools/summarizeIssueTool.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ Patch: ${fileChange.patch}
4545
for (const [index, comment] of comments.entries()) {
4646
issueOrPullRequestInfo += `
4747
Comment ${index} :
48+
Author: ${comment.author}
4849
Body: ${comment.body}
4950
`;
5051
}
@@ -71,7 +72,8 @@ Body: ${comment.body}
7172
You are an AI assistant who is very proficient in summarizing issues and PRs.
7273
You will be given information relative to an issue or PR : the title, the body and the comments. In the case of a PR you will also be given patches of the PR changes.
7374
Your task is to output a summary of all this information.
74-
Do not output code. When you try to summarize PR changes, write in a textual format.
75+
Do not output code. When you try to summarize PR changes, summarize in a textual format.
76+
When you summarize comments, give a summary of each comment and mention the author clearly.
7577
Make sure the summary is at least as short or shorter than the issue or PR with the comments and the patches if there are.
7678
`;
7779
}

0 commit comments

Comments
 (0)