Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions packages/opencode/src/cli/cmd/github.handler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1263,6 +1263,23 @@ export const githubRun = Effect.fn("Cli.github.run")(function* (args: { event?:

async function createComment(body: string) {
// Only called for non-schedule events, so issueId is defined
if (commentType === "pr_review") {
const comment = (payload as PullRequestReviewCommentEvent).comment
console.log("Creating review thread reply...")
try {
return await octoRest.rest.pulls.createReplyForReviewComment({
owner,
repo,
pull_number: issueId!,
// Replies must target the thread's root comment; a reply's own id is rejected
comment_id: comment.in_reply_to_id ?? comment.id,
body,
})
} catch (error) {
// Fall through to a top-level comment so the response is never lost
console.error(`Failed to reply in the review thread: ${error}`)
}
}
console.log("Creating comment...")
return await octoRest.rest.issues.createComment({
owner,
Expand Down
Loading