Standardize on top-level triggerer property (#361)

* Standardize on top-level `triggerer` property

- Rename `triggeringUser` → `triggerer` as the single top-level payload property
- Remove redundant `triggerer` from `FixReviewEvent`, add `approvedOnly` boolean
- Auto-apply `approved_by` filtering in `get_review_comments` when `approvedOnly` is set
- Auto-assign created PRs to the triggerer
- Simplify `AddressReviews` mode prompt
- Accept both `triggerer` and `triggeringUser` in schema for backward compat

* Address review feedback: simplify approved_only, remove addAssignees, drop approved_by param

* Fix formatting in `action/mcp/pr.ts`

* re-add triggeringUser backward-compat fallback in payload schema

* auto-assign created PRs to the triggerer

* Revert "auto-assign created PRs to the triggerer"

This reverts commit c088c425fea33793eb299a001ffd253798d2c674.

* Revert "re-add triggeringUser backward-compat fallback in payload schema"

This reverts commit ae5b3cb3f1377cd4a634b2d48962c785c31013f3.

* backend compat

* tweak prompt to ensure compat

* Address review feedback

* chore: remove triggeringUser fallback

---------

Co-authored-by: pullfrog[bot] <226033991+pullfrog[bot]@users.noreply.github.com>
Co-authored-by: Mateusz Burzyński <mateuszburzynski@gmail.com>
Co-authored-by: Colin McDonnell <colinmcd94@gmail.com>
This commit is contained in:
pullfrog[bot]
2026-02-27 12:43:37 +00:00
committed by pullfrog[bot]
parent 20b08b5321
commit c456fae716
6 changed files with 29 additions and 30 deletions
+9 -11
View File
@@ -143167,8 +143167,8 @@ function CreatePullRequestTool(ctx) {
base: params.base,
draft: params.draft ?? false
});
const reviewer = ctx.payload.triggeringUser;
if (reviewer && !params.draft) {
const reviewer = ctx.payload.triggerer;
if (reviewer) {
try {
log.debug(`requesting review from ${reviewer} on PR #${result.data.number}`);
await ctx.octokit.rest.pulls.requestReviewers({
@@ -143543,10 +143543,7 @@ function extractFromFilePatches(hunks, startLine, endLine, side) {
}
var GetReviewComments = type({
pull_number: type.number.describe("The pull request number"),
review_id: type.number.describe("The review ID to get comments for"),
approved_by: type.string.describe(
"Optional GitHub username - only return threads where this user gave a \u{1F44D} to at least one comment"
).optional()
review_id: type.number.describe("The review ID to get comments for")
});
function hasThumbsUpFrom(comment, username) {
if (!comment.reactionGroups) return false;
@@ -143720,16 +143717,17 @@ async function getReviewData(input) {
function GetReviewCommentsTool(ctx) {
return tool({
name: "get_review_comments",
description: "Get review comments for a pull request review with full thread context. When approved_by is provided, only returns threads where that user gave a \u{1F44D} to at least one comment. Returns a TOC and commentsPath pointing to a markdown file with full comment details.",
description: "Get review comments for a pull request review with full thread context. Automatically filters to approved comments when applicable. Returns a TOC and commentsPath pointing to a markdown file with full comment details.",
parameters: GetReviewComments,
execute: execute(async (params) => {
const approvedBy = ctx.payload.event.trigger === "fix_review" && ctx.payload.event.approved_only ? ctx.payload.triggerer : void 0;
const result = await getReviewData({
octokit: ctx.octokit,
owner: ctx.repo.owner,
name: ctx.repo.name,
pullNumber: params.pull_number,
reviewId: params.review_id,
approvedBy: params.approved_by
approvedBy
});
if (!result) {
return {
@@ -143739,7 +143737,7 @@ function GetReviewCommentsTool(ctx) {
threadCount: 0,
commentsPath: null,
toc: null,
instructions: params.approved_by ? `no threads with \u{1F44D} from ${params.approved_by}` : "no threads found for this review"
instructions: approvedBy ? `no threads with \u{1F44D} from ${approvedBy}` : "no threads found for this review"
};
}
const { threadBlocks, reviewer, formatted } = result;
@@ -147323,7 +147321,7 @@ var JsonPayload = type({
version: "string",
"agent?": AgentName.or("undefined"),
prompt: "string",
"triggeringUser?": "string | undefined",
"triggerer?": "string | undefined",
"eventInstructions?": "string",
"repoInstructions?": "string",
"event?": "object",
@@ -147416,7 +147414,7 @@ function resolvePayload(resolvedPromptInput, repoSettings) {
version: jsonPayload?.version ?? package_default.version,
agent: resolvedAgent,
prompt,
triggeringUser: jsonPayload?.triggeringUser ?? // it's not a common use case but GITHUB_ACTOR can be a user when the workflow is manually triggered by a user through GitHub Actions UI
triggerer: jsonPayload?.triggerer ?? // it's not a common use case but GITHUB_ACTOR can be a user when the workflow is manually triggered by a user through GitHub Actions UI
(!isPullfrog(process.env.GITHUB_ACTOR) ? process.env.GITHUB_ACTOR : void 0),
eventInstructions: jsonPayload?.eventInstructions,
repoInstructions: jsonPayload?.repoInstructions,