diff --git a/dispatch/entry b/dispatch/entry index a36f5c0..26a4065 100755 --- a/dispatch/entry +++ b/dispatch/entry @@ -137763,11 +137763,6 @@ function CreatePullRequestReviewTool(ctx) { parameters: CreatePullRequestReview, execute: execute(async ({ pull_number, body, commit_id, comments = [] }) => { ctx.toolState.prNumber = pull_number; - const pr = await ctx.octokit.rest.pulls.get({ - owner: ctx.owner, - repo: ctx.name, - pull_number - }); const params = { owner: ctx.owner, repo: ctx.name, @@ -137778,6 +137773,11 @@ function CreatePullRequestReviewTool(ctx) { if (commit_id) { params.commit_id = commit_id; } else { + const pr = await ctx.octokit.rest.pulls.get({ + owner: ctx.owner, + repo: ctx.name, + pull_number + }); params.commit_id = pr.data.head.sha; } if (comments.length > 0) { diff --git a/entry b/entry index 3284900..7f32aae 100755 --- a/entry +++ b/entry @@ -137763,11 +137763,6 @@ function CreatePullRequestReviewTool(ctx) { parameters: CreatePullRequestReview, execute: execute(async ({ pull_number, body, commit_id, comments = [] }) => { ctx.toolState.prNumber = pull_number; - const pr = await ctx.octokit.rest.pulls.get({ - owner: ctx.owner, - repo: ctx.name, - pull_number - }); const params = { owner: ctx.owner, repo: ctx.name, @@ -137778,6 +137773,11 @@ function CreatePullRequestReviewTool(ctx) { if (commit_id) { params.commit_id = commit_id; } else { + const pr = await ctx.octokit.rest.pulls.get({ + owner: ctx.owner, + repo: ctx.name, + pull_number + }); params.commit_id = pr.data.head.sha; } if (comments.length > 0) { diff --git a/mcp/review.ts b/mcp/review.ts index 30c2477..4fcf512 100644 --- a/mcp/review.ts +++ b/mcp/review.ts @@ -55,13 +55,6 @@ export function CreatePullRequestReviewTool(ctx: ToolContext) { // set PR context ctx.toolState.prNumber = pull_number; - // get the PR to determine the head commit if commit_id not provided - const pr = await ctx.octokit.rest.pulls.get({ - owner: ctx.owner, - repo: ctx.name, - pull_number, - }); - // compose the request const params: RestEndpointMethodTypes["pulls"]["createReview"]["parameters"] = { owner: ctx.owner, @@ -73,6 +66,12 @@ export function CreatePullRequestReviewTool(ctx: ToolContext) { if (commit_id) { params.commit_id = commit_id; } else { + // get the PR to determine the head commit if commit_id not provided + const pr = await ctx.octokit.rest.pulls.get({ + owner: ctx.owner, + repo: ctx.name, + pull_number, + }); params.commit_id = pr.data.head.sha; } if (comments.length > 0) { diff --git a/run/entry b/run/entry index 44774d1..2ba2370 100755 --- a/run/entry +++ b/run/entry @@ -137763,11 +137763,6 @@ function CreatePullRequestReviewTool(ctx) { parameters: CreatePullRequestReview, execute: execute(async ({ pull_number, body, commit_id, comments = [] }) => { ctx.toolState.prNumber = pull_number; - const pr = await ctx.octokit.rest.pulls.get({ - owner: ctx.owner, - repo: ctx.name, - pull_number - }); const params = { owner: ctx.owner, repo: ctx.name, @@ -137778,6 +137773,11 @@ function CreatePullRequestReviewTool(ctx) { if (commit_id) { params.commit_id = commit_id; } else { + const pr = await ctx.octokit.rest.pulls.get({ + owner: ctx.owner, + repo: ctx.name, + pull_number + }); params.commit_id = pr.data.head.sha; } if (comments.length > 0) {