fix: filtering github bot comments (#587)

* fix: filtering gh bot comments

* cr

* cr

* test empty commit

* [skip ci]

* [skip deploy]
This commit is contained in:
Brace Sproul 2025-07-29 10:15:05 -07:00 • committed by GitHub
parent 1bb24ac7c8
commit fb705d367a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 7 additions and 16 deletions

View file

@ -381,11 +381,11 @@ export async function getIssueComments({
return comments;
}
return comments.filter((comment) => {
return (
comment.user?.type !== "Bot" || !comment.user?.name?.includes("[bot]")
);
});
return comments.filter(
(comment) =>
comment.user?.type !== "Bot" &&
!comment.user?.login?.includes("[bot]"),
);
},
githubInstallationToken,
"Failed to get issue comments",

View file

@ -93,17 +93,8 @@ export async function getMissingMessages(
});
}
// Filter comments from the open swe bot
const filteredComments = comments?.filter(
(c) => c.user?.login.startsWith("open-swe") === false,
);
const untrackedCommentMessages = filteredComments?.length
? getUntrackedComments(
input.messages,
input.githubIssueId,
filteredComments,
)
const untrackedCommentMessages = comments?.length
? getUntrackedComments(input.messages, input.githubIssueId, comments)
: [];
return [...(issueMessage ? [issueMessage] : []), ...untrackedCommentMessages];