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;
} }
return comments.filter((comment) => { return comments.filter(
return ( (comment) =>
comment.user?.type !== "Bot" || !comment.user?.name?.includes("[bot]") comment.user?.type !== "Bot" &&
); !comment.user?.login?.includes("[bot]"),
}); );
}, },
githubInstallationToken, githubInstallationToken,
"Failed to get issue comments", "Failed to get issue comments",

View file

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