Skip to content

feat: Add edit_issue_comment tool #872

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

kaovilai
Copy link

Summary

  • Implements the edit_issue_comment tool to allow editing existing issue comments via the GitHub API
  • Addresses the feature request in issue Feature Request: Add support for editing issue comments #868 for editing issue comments after posting
  • Follows the same implementation pattern as other issue-related tools in the codebase

Changes

  • Added EditIssueComment function in pkg/github/issues.go that uses the GitHub API's EditComment endpoint
  • Registered the new tool in pkg/github/tools.go in the write tools section
  • Added comprehensive tests including success cases, error handling, and parameter validation
  • Updated README documentation with the new tool and its parameters

Test Plan

  • Unit tests added and passing for all scenarios
  • Tested error handling for missing parameters
  • Tested error handling for non-existent comments
  • Manual testing with real GitHub API

Fixes #868

🤖 Generated with Claude Code

kaovilai and others added 4 commits August 13, 2025 13:26
Implements the edit_issue_comment tool to allow editing existing issue comments
via the GitHub API. This addresses the feature request in issue github#868.

Changes:
- Added EditIssueComment function in pkg/github/issues.go
- Registered the new tool in pkg/github/tools.go
- Added comprehensive tests for the new functionality
- Updated README documentation with the new tool

Fixes github#868

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
- Use ghErrors.NewGitHubAPIErrorResponse for consistent error handling
- Remove redundant status code check after successful API call
- Update test expectation to match new error format

Addresses review comments from PR #2
Signed-off-by: Tiger Kaovilai <passawit.kaovilai@gmail.com>
@kaovilai kaovilai marked this pull request as ready for review August 13, 2025 18:45
@kaovilai kaovilai requested a review from a team as a code owner August 13, 2025 18:45
@Copilot Copilot AI review requested due to automatic review settings August 13, 2025 18:45
Change test expectation to verify the stable prefix 'failed to edit comment:'
rather than checking for the HTTP method string. This makes the test less
dependent on implementation details of the error wrapper.
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Feature Request: Add support for editing issue comments
1 participant