diff --git a/scripts/github/real-behavior-proof-policy.mjs b/scripts/github/real-behavior-proof-policy.mjs index b4242a91276..454b3536494 100644 --- a/scripts/github/real-behavior-proof-policy.mjs +++ b/scripts/github/real-behavior-proof-policy.mjs @@ -6,7 +6,7 @@ export const MOCK_ONLY_PROOF_LABEL = "triage: mock-only-proof"; export const MAINTAINER_TEAM_SLUG = "maintainer"; export const CLAWSWEEPER_PROOF_VERDICT_STATUS = "clawsweeper_exact_head_pass"; -const CLAWSWEEPER_BOT_LOGIN = "clawsweeper[bot]"; +const CLAWSWEEPER_BOT_LOGINS = new Set(["clawsweeper[bot]", "openclaw-clawsweeper[bot]"]); const privilegedAuthorAssociations = new Set(["OWNER", "MEMBER", "COLLABORATOR"]); @@ -251,10 +251,10 @@ function isTrustedClawSweeperComment(comment) { return true; } // GitHub can omit performed_via_github_app on issue comments while still - // returning the reserved App bot identity. + // returning a reserved ClawSweeper App bot identity. const login = String(comment?.user?.login ?? "").toLowerCase(); const userType = String(comment?.user?.type ?? ""); - return login === CLAWSWEEPER_BOT_LOGIN && userType === "Bot"; + return CLAWSWEEPER_BOT_LOGINS.has(login) && userType === "Bot"; } export function hasClawSweeperExactHeadProof({ pullRequest, comments = [] } = {}) { diff --git a/test/scripts/real-behavior-proof-policy.test.ts b/test/scripts/real-behavior-proof-policy.test.ts index 7ce18a4b24f..d6f14c2828b 100644 --- a/test/scripts/real-behavior-proof-policy.test.ts +++ b/test/scripts/real-behavior-proof-policy.test.ts @@ -255,6 +255,27 @@ describe("real-behavior-proof-policy", () => { expect(evaluateClawSweeperExactHeadProof({ pullRequest, comments }).passed).toBe(true); }); + it("accepts exact OpenClaw ClawSweeper bot pass verdict markers when GitHub omits the app source", () => { + const pullRequest = { + number: 83581, + head: { + sha: "06ee95df6608d29a395c52ba8ab53fdd93a9dc4f", + }, + }; + const comments = [ + { + user: { + login: "openclaw-clawsweeper[bot]", + type: "Bot", + }, + body: "", + }, + ]; + + expect(hasClawSweeperExactHeadProof({ pullRequest, comments })).toBe(true); + expect(evaluateClawSweeperExactHeadProof({ pullRequest, comments }).passed).toBe(true); + }); + it("rejects bot-shaped pass verdict markers from other bot users", () => { const pullRequest = { number: 83581,