diff --git a/dist/index.js b/dist/index.js index 70d36992..7b08a58f 100644 --- a/dist/index.js +++ b/dist/index.js @@ -3598,8 +3598,10 @@ Current date: ${currentDate}`; "use strict"; /* harmony export */ __nccwpck_require__.d(__webpack_exports__, { /* harmony export */ "Es": () => (/* binding */ Commenter), +/* harmony export */ "O$": () => (/* binding */ SHORT_SUMMARY_START_TAG), /* harmony export */ "Rp": () => (/* binding */ SUMMARIZE_TAG), /* harmony export */ "Rs": () => (/* binding */ COMMENT_TAG), +/* harmony export */ "Zb": () => (/* binding */ SHORT_SUMMARY_END_TAG), /* harmony export */ "aD": () => (/* binding */ COMMENT_REPLY_TAG), /* harmony export */ "oi": () => (/* binding */ RAW_SUMMARY_START_TAG), /* harmony export */ "rV": () => (/* binding */ RAW_SUMMARY_END_TAG) @@ -3629,6 +3631,11 @@ const RAW_SUMMARY_START_TAG = ` `; +const SHORT_SUMMARY_START_TAG = ` + +`; const COMMIT_ID_START_TAG = ''; const COMMIT_ID_END_TAG = ''; class Commenter { @@ -3685,6 +3692,9 @@ ${tag}`; getRawSummary(summary) { return this.getContentWithinTags(summary, RAW_SUMMARY_START_TAG, RAW_SUMMARY_END_TAG); } + getShortSummary(summary) { + return this.getContentWithinTags(summary, SHORT_SUMMARY_START_TAG, SHORT_SUMMARY_END_TAG); + } getDescription(description) { return this.removeContentWithinTags(description, DESCRIPTION_START_TAG, DESCRIPTION_END_TAG); } @@ -4116,6 +4126,7 @@ class Inputs { title; description; rawSummary; + shortSummary; filename; fileContent; fileDiff; @@ -4123,11 +4134,12 @@ class Inputs { diff; commentChain; comment; - constructor(systemMessage = '', title = 'no title provided', description = 'no description provided', rawSummary = '', filename = '', fileContent = 'file contents cannot be provided', fileDiff = 'file diff cannot be provided', patches = '', diff = 'no diff', commentChain = 'no other comments on this patch', comment = 'no comment provided') { + constructor(systemMessage = '', title = 'no title provided', description = 'no description provided', rawSummary = '', shortSummary = '', filename = '', fileContent = 'file contents cannot be provided', fileDiff = 'file diff cannot be provided', patches = '', diff = 'no diff', commentChain = 'no other comments on this patch', comment = 'no comment provided') { this.systemMessage = systemMessage; this.title = title; this.description = description; this.rawSummary = rawSummary; + this.shortSummary = shortSummary; this.filename = filename; this.fileContent = fileContent; this.fileDiff = fileDiff; @@ -4137,7 +4149,7 @@ class Inputs { this.comment = comment; } clone() { - return new Inputs(this.systemMessage, this.title, this.description, this.rawSummary, this.filename, this.fileContent, this.fileDiff, this.patches, this.diff, this.commentChain, this.comment); + return new Inputs(this.systemMessage, this.title, this.description, this.rawSummary, this.shortSummary, this.filename, this.fileContent, this.fileDiff, this.patches, this.diff, this.commentChain, this.comment); } render(content) { if (!content) { @@ -4155,6 +4167,9 @@ class Inputs { if (this.rawSummary) { content = content.replace('$raw_summary', this.rawSummary); } + if (this.shortSummary) { + content = content.replace('$short_summary', this.shortSummary); + } if (this.filename) { content = content.replace('$filename', this.filename); } @@ -6298,6 +6313,11 @@ $raw_summary $raw_summary \`\`\` +`; + summarizeShort = `Your task is to provide a concise summary of the changes +and the goal of this PR. This summary will be used as a prompt while reviewing each +file and must be very clear for the AI bot to understand. The summary should not +exceed 250 words. `; reviewFileDiff = `## GitHub PR Title @@ -6309,14 +6329,43 @@ $raw_summary $description \`\`\` -## Instructions for you +## Summary generated by the AI bot + +\`\`\` +$short_summary +\`\`\` + +## How to parse the changes + +The format for changes provided below consists of multiple change +sections, each containing a new hunk (annotated with line numbers), +an old hunk, and optionally, existing comment chains. Note that the +old hunk code has been replaced by the new hunk to fulfill the +goal of this PR. The line number annotation on each line in the new +hunk is of the format \`\`. + +### Format for changes + + ---new_hunk--- + \`\`\` + + \`\`\` + + ---old_hunk--- + \`\`\` + + \`\`\` + + ---comment_chains--- + \`\`\` + + \`\`\` + + ---end_change_section--- + ... + +## How you must respond -- The format for changes provided below consists of multiple change - sections, each containing a new hunk (annotated with line numbers), - an old hunk, and optionally, existing comment chains. Note that the - old hunk code has been replaced by the new hunk. The line number - annotation on each line in the new hunk is of the format - \`\` , i.e. \`^*(\\d+): \`. - Your task is to review ONLY the new hunks line by line, ONLY pointing out substantive issues within line number ranges. Provide the exact line number range (inclusive) for each issue. Take into account any supplementary @@ -6324,7 +6373,7 @@ $description review process. Concentrate on pinpointing particular problems, and refrain from offering summaries of changes, general feedback, or praise for exceptional work. -- IMPORTANT: Respond only in the response format (consisting of review +- IMPORTANT: Respond only in the below response format (consisting of review sections). Each review section must have a line number range and a review comment for that range. Do not include general feedback or summaries. You may optionally include a single replacement suggestion snippet and/or @@ -6357,26 +6406,6 @@ $description - Reflect on your comments and line number ranges before sending the final response to ensure accuracy of line number ranges and replacement snippets. -### Format for changes - - ---new_hunk--- - \`\`\` - - \`\`\` - - ---old_hunk--- - \`\`\` - - \`\`\` - - ---comment_chains--- - \`\`\` - - \`\`\` - - ---end_change_section--- - ... - ### Response format expected -: @@ -6396,6 +6425,8 @@ $description --- ... +## Example + ### Example changes ---new_hunk--- @@ -6442,10 +6473,10 @@ the instructions in that comment. $description \`\`\` -## OpenAI generated summary +## Summary generated by the AI bot \`\`\` -$raw_summary +$short_summary \`\`\` ## Entire diff @@ -6506,8 +6537,13 @@ $comment const prompt = this.summarizePrefix + this.summarize; return inputs.render(prompt); } + renderSummarizeShort(inputs) { + const prompt = this.summarizePrefix + this.summarizeShort; + return inputs.render(prompt); + } renderSummarizeReleaseNotes(inputs) { - return inputs.render(this.summarizeReleaseNotes); + const prompt = this.summarizePrefix + this.summarizeReleaseNotes; + return inputs.render(prompt); } renderComment(inputs) { return inputs.render(this.comment); @@ -6593,25 +6629,6 @@ const handleReviewComment = async (heavyBot, options, prompts) => { if (commentChain.includes(_commenter__WEBPACK_IMPORTED_MODULE_2__/* .COMMENT_TAG */ .Rs) || commentChain.includes(_commenter__WEBPACK_IMPORTED_MODULE_2__/* .COMMENT_REPLY_TAG */ .aD) || comment.body.includes(ASK_BOT)) { - let fileContent = ''; - try { - const contents = await _octokit__WEBPACK_IMPORTED_MODULE_3__/* .octokit.repos.getContent */ .K.repos.getContent({ - owner: repo.owner, - repo: repo.repo, - path: comment.path, - ref: context.payload.pull_request.base.sha - }); - if (contents.data) { - if (!Array.isArray(contents.data)) { - if (contents.data.type === 'file' && contents.data.content) { - fileContent = Buffer.from(contents.data.content, 'base64').toString(); - } - } - } - } - catch (error) { - (0,_actions_core__WEBPACK_IMPORTED_MODULE_0__.warning)(`Failed to get file contents: ${error}, skipping.`); - } let fileDiff = ''; try { // get diff for this file by comparing the base and head commits @@ -6651,18 +6668,7 @@ const handleReviewComment = async (heavyBot, options, prompts) => { await commenter.reviewCommentReply(pullNumber, topLevelComment, 'Cannot reply to this comment as diff being commented is too large and exceeds the token limit.'); return; } - // pack file content and diff into the inputs if they are not too long - if (fileContent.length > 0) { - // count occurrences of $file_content in prompt - const fileContentCount = prompts.comment.split('$file_content').length - 1; - const fileContentTokens = (0,_tokenizer__WEBPACK_IMPORTED_MODULE_4__/* .getTokenCount */ .V)(fileContent); - if (fileContentCount > 0 && - tokens + fileContentTokens * fileContentCount <= - options.heavyTokenLimits.requestTokens) { - tokens += fileContentTokens * fileContentCount; - inputs.fileContent = fileContent; - } - } + // pack file diff into the inputs if they are not too long if (fileDiff.length > 0) { // count occurrences of $file_diff in prompt const fileDiffCount = prompts.comment.split('$file_diff').length - 1; @@ -6677,12 +6683,13 @@ const handleReviewComment = async (heavyBot, options, prompts) => { // get summary of the PR const summary = await commenter.findCommentWithTag(_commenter__WEBPACK_IMPORTED_MODULE_2__/* .SUMMARIZE_TAG */ .Rp, pullNumber); if (summary) { - // pack summary into the inputs if it is not too long - const rawSummary = commenter.getRawSummary(summary.body); - const summaryTokens = (0,_tokenizer__WEBPACK_IMPORTED_MODULE_4__/* .getTokenCount */ .V)(rawSummary); - if (tokens + summaryTokens <= options.heavyTokenLimits.requestTokens) { - tokens += summaryTokens; - inputs.rawSummary = rawSummary; + // pack short summary into the inputs if it is not too long + const shortSummary = commenter.getShortSummary(summary.body); + const shortSummaryTokens = (0,_tokenizer__WEBPACK_IMPORTED_MODULE_4__/* .getTokenCount */ .V)(shortSummary); + if (tokens + shortSummaryTokens <= + options.heavyTokenLimits.requestTokens) { + tokens += shortSummaryTokens; + inputs.shortSummary = shortSummary; } } const [reply] = await heavyBot.chat(prompts.renderComment(inputs), {}); @@ -6900,6 +6907,7 @@ const codeReview = async (lightBot, heavyBot, options, prompts) => { let existingCommitIdsBlock = ''; if (existingSummarizeCmt != null) { inputs.rawSummary = commenter.getRawSummary(existingSummarizeCmt.body); + inputs.shortSummary = commenter.getShortSummary(existingSummarizeCmt.body); existingCommitIdsBlock = commenter.getReviewedCommitIdsBlock(existingSummarizeCmt.body); } const allCommitIds = await commenter.getAllCommitIds(); @@ -7050,18 +7058,6 @@ ${hunks.oldHunk} } ins.fileDiff = fileDiff; tokens += fileDiff.length; - // optionally pack file_content - if (fileContent.length > 0) { - // count occurrences of $file_content in prompt - const fileContentCount = prompts.summarizeFileDiff.split('$file_content').length - 1; - const fileContentTokens = (0,tokenizer/* getTokenCount */.V)(fileContent); - if (fileContentCount > 0 && - tokens + fileContentTokens * fileContentCount <= - options.lightTokenLimits.requestTokens) { - tokens += fileContentTokens * fileContentCount; - ins.fileContent = fileContent; - } - } // summarize content try { const [summarizeResp] = await lightBot.chat(prompts.renderSummarizeFileDiff(ins, options.reviewSimpleChanges), {}); @@ -7127,23 +7123,18 @@ ${filename}: ${summary} } } } - let nextSummarizeIds = {}; // final summary - const [summarizeFinalResponse, summarizeFinalResponseIds] = await heavyBot.chat(prompts.renderSummarize(inputs), nextSummarizeIds); + const [summarizeFinalResponse] = await heavyBot.chat(prompts.renderSummarize(inputs), {}); if (summarizeFinalResponse === '') { (0,core.info)('summarize: nothing obtained from openai'); } - else { - nextSummarizeIds = summarizeFinalResponseIds; - } if (options.disableReleaseNotes === false) { // final release notes - const [releaseNotesResponse, releaseNotesIds] = await heavyBot.chat(prompts.renderSummarizeReleaseNotes(inputs), nextSummarizeIds); + const [releaseNotesResponse] = await heavyBot.chat(prompts.renderSummarizeReleaseNotes(inputs), {}); if (releaseNotesResponse === '') { (0,core.info)('release notes: nothing obtained from openai'); } else { - nextSummarizeIds = releaseNotesIds; let message = '### Summary by OpenAI\n\n'; message += releaseNotesResponse; try { @@ -7154,10 +7145,16 @@ ${filename}: ${summary} } } } + // generate a short summary as well + const [summarizeShortResponse] = await heavyBot.chat(prompts.renderSummarizeShort(inputs), {}); + inputs.shortSummary = summarizeShortResponse; let summarizeComment = `${summarizeFinalResponse} ${lib_commenter/* RAW_SUMMARY_START_TAG */.oi} ${inputs.rawSummary} ${lib_commenter/* RAW_SUMMARY_END_TAG */.rV} +${lib_commenter/* SHORT_SUMMARY_START_TAG */.O$} +${inputs.shortSummary} +${lib_commenter/* SHORT_SUMMARY_END_TAG */.Zb} --- ### Chat with 🤖 OpenAI Bot (\`@openai\`) @@ -7240,15 +7237,6 @@ ${summariesFailed.length > 0 tokens += patchTokens; patchesToPack += 1; } - // try packing file_content into this request - const fileContentCount = prompts.reviewFileDiff.split('$file_content').length - 1; - const fileContentTokens = (0,tokenizer/* getTokenCount */.V)(fileContent); - if (fileContentCount > 0 && - tokens + fileContentTokens * fileContentCount <= - options.heavyTokenLimits.requestTokens) { - ins.fileContent = fileContent; - tokens += fileContentTokens * fileContentCount; - } let patchesPacked = 0; for (const [startLine, endLine, patch] of patches) { if (context.payload.pull_request == null) { diff --git a/src/commenter.ts b/src/commenter.ts index c05f0ee3..65c91134 100644 --- a/src/commenter.ts +++ b/src/commenter.ts @@ -29,6 +29,13 @@ export const RAW_SUMMARY_START_TAG = ` ` +export const SHORT_SUMMARY_START_TAG = ` + +` + export const COMMIT_ID_START_TAG = '' export const COMMIT_ID_END_TAG = '' @@ -95,6 +102,14 @@ ${tag}` ) } + getShortSummary(summary: string) { + return this.getContentWithinTags( + summary, + SHORT_SUMMARY_START_TAG, + SHORT_SUMMARY_END_TAG + ) + } + getDescription(description: string) { return this.removeContentWithinTags( description, diff --git a/src/inputs.ts b/src/inputs.ts index 2f844dfb..c391d567 100644 --- a/src/inputs.ts +++ b/src/inputs.ts @@ -3,6 +3,7 @@ export class Inputs { title: string description: string rawSummary: string + shortSummary: string filename: string fileContent: string fileDiff: string @@ -16,6 +17,7 @@ export class Inputs { title = 'no title provided', description = 'no description provided', rawSummary = '', + shortSummary = '', filename = '', fileContent = 'file contents cannot be provided', fileDiff = 'file diff cannot be provided', @@ -28,6 +30,7 @@ export class Inputs { this.title = title this.description = description this.rawSummary = rawSummary + this.shortSummary = shortSummary this.filename = filename this.fileContent = fileContent this.fileDiff = fileDiff @@ -43,6 +46,7 @@ export class Inputs { this.title, this.description, this.rawSummary, + this.shortSummary, this.filename, this.fileContent, this.fileDiff, @@ -69,6 +73,9 @@ export class Inputs { if (this.rawSummary) { content = content.replace('$raw_summary', this.rawSummary) } + if (this.shortSummary) { + content = content.replace('$short_summary', this.shortSummary) + } if (this.filename) { content = content.replace('$filename', this.filename) } diff --git a/src/prompts.ts b/src/prompts.ts index 813a5ae6..d84c74e1 100644 --- a/src/prompts.ts +++ b/src/prompts.ts @@ -58,6 +58,12 @@ $raw_summary $raw_summary \`\`\` +` + + summarizeShort = `Your task is to provide a concise summary of the changes +and the goal of this PR. This summary will be used as a prompt while reviewing each +file and must be very clear for the AI bot to understand. The summary should not +exceed 250 words. ` reviewFileDiff = `## GitHub PR Title @@ -70,14 +76,43 @@ $raw_summary $description \`\`\` -## Instructions for you +## Summary generated by the AI bot + +\`\`\` +$short_summary +\`\`\` + +## How to parse the changes + +The format for changes provided below consists of multiple change +sections, each containing a new hunk (annotated with line numbers), +an old hunk, and optionally, existing comment chains. Note that the +old hunk code has been replaced by the new hunk to fulfill the +goal of this PR. The line number annotation on each line in the new +hunk is of the format \`\`. + +### Format for changes + + ---new_hunk--- + \`\`\` + + \`\`\` + + ---old_hunk--- + \`\`\` + + \`\`\` + + ---comment_chains--- + \`\`\` + + \`\`\` + + ---end_change_section--- + ... + +## How you must respond -- The format for changes provided below consists of multiple change - sections, each containing a new hunk (annotated with line numbers), - an old hunk, and optionally, existing comment chains. Note that the - old hunk code has been replaced by the new hunk. The line number - annotation on each line in the new hunk is of the format - \`\` , i.e. \`^*(\\d+): \`. - Your task is to review ONLY the new hunks line by line, ONLY pointing out substantive issues within line number ranges. Provide the exact line number range (inclusive) for each issue. Take into account any supplementary @@ -85,7 +120,7 @@ $description review process. Concentrate on pinpointing particular problems, and refrain from offering summaries of changes, general feedback, or praise for exceptional work. -- IMPORTANT: Respond only in the response format (consisting of review +- IMPORTANT: Respond only in the below response format (consisting of review sections). Each review section must have a line number range and a review comment for that range. Do not include general feedback or summaries. You may optionally include a single replacement suggestion snippet and/or @@ -118,26 +153,6 @@ $description - Reflect on your comments and line number ranges before sending the final response to ensure accuracy of line number ranges and replacement snippets. -### Format for changes - - ---new_hunk--- - \`\`\` - - \`\`\` - - ---old_hunk--- - \`\`\` - - \`\`\` - - ---comment_chains--- - \`\`\` - - \`\`\` - - ---end_change_section--- - ... - ### Response format expected -: @@ -157,6 +172,8 @@ $description --- ... +## Example + ### Example changes ---new_hunk--- @@ -204,10 +221,10 @@ the instructions in that comment. $description \`\`\` -## OpenAI generated summary +## Summary generated by the AI bot \`\`\` -$raw_summary +$short_summary \`\`\` ## Entire diff @@ -276,8 +293,14 @@ $comment return inputs.render(prompt) } + renderSummarizeShort(inputs: Inputs): string { + const prompt = this.summarizePrefix + this.summarizeShort + return inputs.render(prompt) + } + renderSummarizeReleaseNotes(inputs: Inputs): string { - return inputs.render(this.summarizeReleaseNotes) + const prompt = this.summarizePrefix + this.summarizeReleaseNotes + return inputs.render(prompt) } renderComment(inputs: Inputs): string { diff --git a/src/review-comment.ts b/src/review-comment.ts index 6fe60dc7..1a5b0b17 100644 --- a/src/review-comment.ts +++ b/src/review-comment.ts @@ -91,28 +91,6 @@ export const handleReviewComment = async ( commentChain.includes(COMMENT_REPLY_TAG) || comment.body.includes(ASK_BOT) ) { - let fileContent = '' - try { - const contents = await octokit.repos.getContent({ - owner: repo.owner, - repo: repo.repo, - path: comment.path, - ref: context.payload.pull_request.base.sha - }) - if (contents.data) { - if (!Array.isArray(contents.data)) { - if (contents.data.type === 'file' && contents.data.content) { - fileContent = Buffer.from( - contents.data.content, - 'base64' - ).toString() - } - } - } - } catch (error) { - warning(`Failed to get file contents: ${error}, skipping.`) - } - let fileDiff = '' try { // get diff for this file by comparing the base and head commits @@ -161,22 +139,7 @@ export const handleReviewComment = async ( ) return } - // pack file content and diff into the inputs if they are not too long - if (fileContent.length > 0) { - // count occurrences of $file_content in prompt - const fileContentCount = - prompts.comment.split('$file_content').length - 1 - const fileContentTokens = getTokenCount(fileContent) - if ( - fileContentCount > 0 && - tokens + fileContentTokens * fileContentCount <= - options.heavyTokenLimits.requestTokens - ) { - tokens += fileContentTokens * fileContentCount - inputs.fileContent = fileContent - } - } - + // pack file diff into the inputs if they are not too long if (fileDiff.length > 0) { // count occurrences of $file_diff in prompt const fileDiffCount = prompts.comment.split('$file_diff').length - 1 @@ -197,12 +160,15 @@ export const handleReviewComment = async ( pullNumber ) if (summary) { - // pack summary into the inputs if it is not too long - const rawSummary = commenter.getRawSummary(summary.body) - const summaryTokens = getTokenCount(rawSummary) - if (tokens + summaryTokens <= options.heavyTokenLimits.requestTokens) { - tokens += summaryTokens - inputs.rawSummary = rawSummary + // pack short summary into the inputs if it is not too long + const shortSummary = commenter.getShortSummary(summary.body) + const shortSummaryTokens = getTokenCount(shortSummary) + if ( + tokens + shortSummaryTokens <= + options.heavyTokenLimits.requestTokens + ) { + tokens += shortSummaryTokens + inputs.shortSummary = shortSummary } } diff --git a/src/review.ts b/src/review.ts index 137f1b67..58bcb1ee 100644 --- a/src/review.ts +++ b/src/review.ts @@ -8,6 +8,8 @@ import { COMMENT_REPLY_TAG, RAW_SUMMARY_END_TAG, RAW_SUMMARY_START_TAG, + SHORT_SUMMARY_END_TAG, + SHORT_SUMMARY_START_TAG, SUMMARIZE_TAG } from './commenter' import {Inputs} from './inputs' @@ -71,6 +73,7 @@ export const codeReview = async ( let existingCommitIdsBlock = '' if (existingSummarizeCmt != null) { inputs.rawSummary = commenter.getRawSummary(existingSummarizeCmt.body) + inputs.shortSummary = commenter.getShortSummary(existingSummarizeCmt.body) existingCommitIdsBlock = commenter.getReviewedCommitIdsBlock( existingSummarizeCmt.body ) @@ -276,21 +279,6 @@ ${hunks.oldHunk} ins.fileDiff = fileDiff tokens += fileDiff.length - // optionally pack file_content - if (fileContent.length > 0) { - // count occurrences of $file_content in prompt - const fileContentCount = - prompts.summarizeFileDiff.split('$file_content').length - 1 - const fileContentTokens = getTokenCount(fileContent) - if ( - fileContentCount > 0 && - tokens + fileContentTokens * fileContentCount <= - options.lightTokenLimits.requestTokens - ) { - tokens += fileContentTokens * fileContentCount - ins.fileContent = fileContent - } - } // summarize content try { const [summarizeResp] = await lightBot.chat( @@ -371,27 +359,24 @@ ${filename}: ${summary} } } - let nextSummarizeIds = {} - // final summary - const [summarizeFinalResponse, summarizeFinalResponseIds] = - await heavyBot.chat(prompts.renderSummarize(inputs), nextSummarizeIds) + const [summarizeFinalResponse] = await heavyBot.chat( + prompts.renderSummarize(inputs), + {} + ) if (summarizeFinalResponse === '') { info('summarize: nothing obtained from openai') - } else { - nextSummarizeIds = summarizeFinalResponseIds } if (options.disableReleaseNotes === false) { // final release notes - const [releaseNotesResponse, releaseNotesIds] = await heavyBot.chat( + const [releaseNotesResponse] = await heavyBot.chat( prompts.renderSummarizeReleaseNotes(inputs), - nextSummarizeIds + {} ) if (releaseNotesResponse === '') { info('release notes: nothing obtained from openai') } else { - nextSummarizeIds = releaseNotesIds let message = '### Summary by OpenAI\n\n' message += releaseNotesResponse try { @@ -405,10 +390,20 @@ ${filename}: ${summary} } } + // generate a short summary as well + const [summarizeShortResponse] = await heavyBot.chat( + prompts.renderSummarizeShort(inputs), + {} + ) + inputs.shortSummary = summarizeShortResponse + let summarizeComment = `${summarizeFinalResponse} ${RAW_SUMMARY_START_TAG} ${inputs.rawSummary} ${RAW_SUMMARY_END_TAG} +${SHORT_SUMMARY_START_TAG} +${inputs.shortSummary} +${SHORT_SUMMARY_END_TAG} --- ### Chat with 🤖 OpenAI Bot (\`@openai\`) @@ -473,7 +468,6 @@ ${ : '' } ` - if (!options.disableReview) { const filesAndChangesReview = filesAndChanges.filter(([filename]) => { const needsReview = @@ -520,19 +514,6 @@ ${ patchesToPack += 1 } - // try packing file_content into this request - const fileContentCount = - prompts.reviewFileDiff.split('$file_content').length - 1 - const fileContentTokens = getTokenCount(fileContent) - if ( - fileContentCount > 0 && - tokens + fileContentTokens * fileContentCount <= - options.heavyTokenLimits.requestTokens - ) { - ins.fileContent = fileContent - tokens += fileContentTokens * fileContentCount - } - let patchesPacked = 0 for (const [startLine, endLine, patch] of patches) { if (context.payload.pull_request == null) {