[PR #5778] fix: use correct octokit API for PR review comment reactions #11579

Closed
opened 2026-02-16 18:16:26 -05:00 by yindo · 0 comments
Owner

Original Pull Request: https://github.com/anomalyco/opencode/pull/5778

State: closed
Merged: Yes


When commenting on files in a PR/lines in a PR, opencode attempts to react (with eyes) and fails with a 404, breaking the workflow. This does not occur for issue comments.

There are two different APIs for this via octokit:

  1. one for issue comments - octokit.reactions.createForIssueComment
  2. one for PR comments - octokit.reactions.createForPullRequestReviewComment

opencode did not distinguish between the two - in packages/opencode/src/cli/cmd/github.ts the addReaction() function only worked for issues. I noticed this in my own GH reaction handling and had to make a similar fix.

This PR fixes this by passing a commentType parameter to addReaction() and removeReaction() functions and then using that to switch on the right octokit methods.

(It appears this hasn't been a flow others have run into before? The rest of the PR comment handling looks to be there + OK)

**Original Pull Request:** https://github.com/anomalyco/opencode/pull/5778 **State:** closed **Merged:** Yes --- When commenting on files in a PR/lines in a PR, opencode attempts to react (with eyes) and fails with a 404, breaking the workflow. This does not occur for issue comments. There are two different APIs for this via octokit: 1. one for issue comments - `octokit.reactions.createForIssueComment` 2. one for PR comments - `octokit.reactions.createForPullRequestReviewComment` opencode did not distinguish between the two - in `packages/opencode/src/cli/cmd/github.ts` the `addReaction()` function only worked for issues. I noticed this in my own GH reaction handling and had to make a similar fix. This PR fixes this by passing a `commentType` parameter to `addReaction()` and `removeReaction()` functions and then using that to switch on the right octokit methods. (It appears this hasn't been a flow others have run into before? The rest of the PR comment handling looks to be there + OK)
yindo added the pull-request label 2026-02-16 18:16:26 -05:00
yindo closed this issue 2026-02-16 18:16:26 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#11579