Skip to content

Commit

Permalink
fix: prrc response
Browse files Browse the repository at this point in the history
  • Loading branch information
sshivaditya committed Jan 13, 2025
1 parent 70bf711 commit 22e3915
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/helpers/format-chat-history.ts
Original file line number Diff line number Diff line change
Expand Up @@ -372,6 +372,14 @@ export async function formatChatHistory(context: Context, maxDepth: number = 2):
return ["No main issue found."];
}

if ("pull_request" in context.payload) {
const { diff_hunk, position, original_position, path, body } = context.payload.comment || {};
if (diff_hunk) {
tree.body += `\nPrimary Context: ${body || ""}\nDiff: ${diff_hunk}\nPath: ${path || ""}\nLines: ${position || ""}-${original_position || ""}`;
tree.comments = tree.comments?.filter((comment) => comment.id !== context.payload.comment?.id);
}
}

const treeOutput: string[] = [];
const headerLine = "Issue Tree Structure:";
treeOutput.push(headerLine, "");
Expand Down

0 comments on commit 22e3915

Please sign in to comment.