Skip to content

Commit 9203c22

Browse files
committed
fix
1 parent 19a5d82 commit 9203c22

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

packages/agent/src/agent.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -418,6 +418,11 @@ Generated by PostHog Agent`;
418418
});
419419
}
420420

421+
async getPullRequestReviewComments(prNumber: number): Promise<any> {
422+
this.logger.debug("Fetching PR review comments", { prNumber });
423+
return this.gitManager.getPullRequestReviewComments(prNumber);
424+
}
425+
421426
async updateTaskBranch(taskId: string, branchName: string): Promise<void> {
422427
this.logger.info("Updating task run branch", { taskId, branchName });
423428

packages/agent/src/git-manager.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -593,18 +593,18 @@ Generated by PostHog Agent`;
593593
}
594594
}
595595

596-
async getAllPullRequestComments(prNumber: number): Promise<string> {
596+
async getAllPullRequestComments(prNumber: number): Promise<any> {
597597
try {
598598
const output = await this.runCommand(
599599
`gh pr view ${prNumber} --json comments`,
600600
);
601-
return output;
601+
return JSON.parse(output);
602602
} catch (error) {
603603
throw new Error(`Failed to fetch PR comments: ${error}`);
604604
}
605605
}
606606

607-
async getPullRequestReviewComments(prNumber: number): Promise<string> {
607+
async getPullRequestReviewComments(prNumber: number): Promise<any> {
608608
try {
609609
// Extract repo from remote URL (format: owner/repo)
610610
const remoteUrl = await this.getRemoteUrl();
@@ -625,7 +625,7 @@ Generated by PostHog Agent`;
625625
const output = await this.runCommand(
626626
`gh api repos/${repo}/pulls/${prNumber}/comments`,
627627
);
628-
return output;
628+
return JSON.parse(output);
629629
} catch (error) {
630630
throw new Error(`Failed to fetch PR review comments: ${error}`);
631631
}

0 commit comments

Comments
 (0)