Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
826fcce
feat: add comment-reaction action for responding to user comments
Dec 4, 2025
3d222a3
docs: add integration guide for comment-reaction action
Dec 4, 2025
20355b3
refactor: rename comment-reaction to pr-assistant
Dec 4, 2025
ec23cde
refactor: rename pr-assistant to assistant
Dec 4, 2025
9ed3faf
feat: add Augment API credentials as inputs
Dec 4, 2025
854736b
feat: enhance assistant to implement PR changes using Auggie SDK
Dec 4, 2025
0388a20
docs: update README for PR Assistant functionality
Dec 4, 2025
cb8d090
fix: add reaction immediately for quick user feedback
Dec 4, 2025
38713fd
refactor: move reaction to separate action.yml step for instant feedback
Dec 4, 2025
1bb3c66
fix: install Auggie CLI before running the action
Dec 4, 2025
d9f39d7
fix: set isAnswerOnly to false to actually implement changes
Dec 4, 2025
0484fd3
fix: improve instruction to explicitly require file changes
Dec 4, 2025
7ad8bda
feat: add streaming logs for tool usage
Dec 4, 2025
0b472f7
fix: add delay before closing Auggie to ensure file writes complete
Dec 4, 2025
f4f5585
fix: correct change detection logic in commitAndPush function
Dec 4, 2025
4eb4a8d
fix: pull with rebase before pushing to handle remote changes
Dec 5, 2025
9bdad7b
refactor: remove rebase logic, rely on workflow checkout instead
Dec 5, 2025
cba3c5c
feat: quote original comment in success/failure replies
Dec 5, 2025
816aa04
style: fix code formatting issues
Dec 5, 2025
7dd2275
feat: add support for /pr command to create PR targeting original PR
Dec 8, 2025
7a5530e
refactor: let Auggie agent create PR instead of action code
Dec 8, 2025
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
152 changes: 152 additions & 0 deletions assistant/INTEGRATION_GUIDE.md
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think we need this / agent generated?

Copy link
Author

Choose a reason for hiding this comment

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

Yeah this was agent generated gonna remove.

Original file line number Diff line number Diff line change
@@ -0,0 +1,152 @@
# Comment Reaction Action - Integration Guide

## Summary

A new GitHub Action has been created in the `augment-agent` repository that can react to user comments with emoji reactions. This action is designed to be used in workflows that respond to PR review comments and issue comments.

## Repository Information

- **Repository**: `augmentcode/augment-agent`
- **Branch**: `feature/comment-reaction-action`
- **Action Path**: `comment-reaction/`
- **Commit**: `826fcce`

## What Was Created

### Files Created

1. **comment-reaction/action.yml** - Action metadata and composite action definition
2. **comment-reaction/src/index.ts** - TypeScript implementation
3. **comment-reaction/package.json** - Node.js dependencies
4. **comment-reaction/tsconfig.json** - TypeScript configuration
5. **comment-reaction/README.md** - Documentation and usage examples
6. **comment-reaction/package-lock.json** - Dependency lock file

### Key Features

- ✅ React to PR review comments
- ✅ React to issue comments
- ✅ Support for all 8 GitHub reaction types (+1, -1, laugh, confused, heart, hooray, rocket, eyes)
- ✅ Configurable reaction type with sensible default (eyes)
- ✅ Full TypeScript implementation with type safety
- ✅ Comprehensive error handling and logging
- ✅ Output indicating success/failure

## How to Reference in assistant.yml

### Option 1: Reference the Branch Directly

```yaml
- name: React to original comment with eyes
uses: augmentcode/augment-agent/comment-reaction@feature/comment-reaction-action
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
comment_id: ${{ github.event.comment.id }}
event_name: ${{ github.event_name }}
```

### Option 2: With Custom Reaction

```yaml
- name: React to original comment with rocket
uses: augmentcode/augment-agent/comment-reaction@feature/comment-reaction-action
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
comment_id: ${{ github.event.comment.id }}
event_name: ${{ github.event_name }}
reaction: rocket
```

### Complete Example for assistant.yml

Replace the existing `actions/github-script@v7` step (lines 31-53) with:

```yaml
- name: React to original comment with eyes
uses: augmentcode/augment-agent/comment-reaction@feature/comment-reaction-action
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
comment_id: ${{ github.event.comment.id }}
event_name: ${{ github.event_name }}
reaction: eyes
```

## Inputs

| Input | Description | Required | Default |
| -------------- | --------------------------------- | -------- | ------- |
| `github_token` | GitHub token for API access | Yes | - |
| `comment_id` | The ID of the comment to react to | Yes | - |
| `event_name` | The GitHub event name | Yes | - |
| `reaction` | The reaction type to add | No | `eyes` |

## Outputs

| Output | Description |
| --------- | --------------------------------------------------------------- |
| `success` | Whether the reaction was successfully added (`true` or `false`) |

## Supported Reactions

- `+1` - 👍
- `-1` - 👎
- `laugh` - 😄
- `confused` - 😕
- `heart` - ❤️
- `hooray` - 🎉
- `rocket` - 🚀
- `eyes` - 👀

## Next Steps

1. **Test the Action**: You can now reference this action in the `bumpy/.github/workflows/assistant.yml` file
2. **Merge to Main**: Once tested, merge the `feature/comment-reaction-action` branch to `main`
3. **Create a Tag**: After merging, create a version tag (e.g., `v1.0.0`) for stable references
4. **Update References**: Update workflow files to use the tag instead of the branch name

## Example: Full Workflow Integration

```yaml
name: Augment Agent

on:
pull_request_review_comment:
types: [created]
issue_comment:
types: [created]

permissions:
contents: read
pull-requests: write
issues: write
id-token: write
actions: read

jobs:
auggie-review-comment:
if: |
contains(github.event.comment.body, '@augment') ||
contains(github.event.comment.body, '@Augment')
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
repository: ${{ github.repository }}
token: ${{ secrets.GITHUB_TOKEN }}
ref: ${{ github.event.pull_request.head.ref }}

- name: React to original comment with eyes
uses: augmentcode/augment-agent/comment-reaction@feature/comment-reaction-action
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
comment_id: ${{ github.event.comment.id }}
event_name: ${{ github.event_name }}
reaction: eyes

# ... rest of your workflow steps
```

## Support

For issues or questions, please refer to the README.md in the comment-reaction directory or create an issue in the augment-agent repository.
190 changes: 190 additions & 0 deletions assistant/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,190 @@
# PR Assistant Action

An AI-powered GitHub Action that implements code changes based on PR comments using the Auggie SDK.

## Features

- 🤖 **AI-Powered Implementation**: Uses Auggie SDK to understand and implement requested changes
- 📋 **Context-Aware**: Gathers full PR context including diff, files, and comment threads
- 🔄 **Automatic Commits**: Commits and pushes changes directly to the PR branch
- 💬 **Status Updates**: Posts success/failure comments to the PR
- 👀 **Visual Feedback**: Adds emoji reactions to show processing status
- ✅ **Full TypeScript**: Type-safe implementation with comprehensive error handling

## Usage

### Basic Example

```yaml
- name: PR Assistant
uses: augmentcode/augment-agent/assistant@feature/comment-reaction-action
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
comment_id: ${{ github.event.comment.id }}
event_name: ${{ github.event_name }}
augment_api_token: ${{ secrets.AUGMENT_API_KEY }}
augment_api_url: ${{ secrets.AUGMENT_API_URL }}
```

### With Custom Reaction

```yaml
- name: PR Assistant
uses: augmentcode/augment-agent/assistant@feature/comment-reaction-action

Choose a reason for hiding this comment

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

This doesn't feel right to me.

Copy link
Author

Choose a reason for hiding this comment

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

I decided to create new repo for the comment actions and going to move things there.

https://github.com/augmentcode/augment-action

with:
github_token: ${{ secrets.GITHUB_TOKEN }}
comment_id: ${{ github.event.comment.id }}
event_name: ${{ github.event_name }}
reaction: rocket
augment_api_token: ${{ secrets.AUGMENT_API_KEY }}
augment_api_url: ${{ secrets.AUGMENT_API_URL }}
```

### Complete Workflow Example

```yaml
name: PR Assistant
on:
pull_request_review_comment:
types: [created]
issue_comment:
types: [created]

permissions:
contents: read
pull-requests: write
issues: write

jobs:
assistant:
if: |
contains(github.event.comment.body, '@augment') ||
contains(github.event.comment.body, '@Augment')
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
repository: ${{ github.repository }}
token: ${{ secrets.GITHUB_TOKEN }}
ref: ${{ github.event.pull_request.head.ref }}

- name: Run PR Assistant
uses: augmentcode/augment-agent/assistant@feature/comment-reaction-action
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
comment_id: ${{ github.event.comment.id }}
event_name: ${{ github.event_name }}
reaction: eyes
augment_api_token: ${{ secrets.AUGMENT_API_KEY }}
augment_api_url: ${{ secrets.AUGMENT_API_URL }}
```

## How It Works

1. **Trigger**: Workflow is triggered by a comment containing `@augment` or `@Augment`
2. **React**: Adds an emoji reaction (default: 👀) to show processing has started
3. **Gather Context**: Collects PR metadata, diff, files changed, and comment thread
4. **Invoke Auggie**: Sends the context and instruction to Auggie SDK
5. **Implement**: Auggie analyzes the request and implements the changes
6. **Commit**: Automatically commits changes with a descriptive message
7. **Push**: Pushes the commit to the PR's head branch
8. **Notify**: Posts a success or failure comment to the PR

## Inputs

| Input | Description | Required | Default |
| ------------------- | ------------------------------------------------------------------------ | -------- | ------- |
| `github_token` | GitHub token for API access and git operations | Yes | - |
| `comment_id` | The ID of the comment that triggered the workflow | Yes | - |
| `event_name` | The GitHub event name (`pull_request_review_comment` or `issue_comment`) | Yes | - |
| `augment_api_token` | Augment API token for authentication | Yes | - |
| `augment_api_url` | Augment API URL endpoint | Yes | - |
| `reaction` | The reaction type to add (optional) | No | `eyes` |

## Supported Reactions

- `+1` - 👍
- `-1` - 👎
- `laugh` - 😄
- `confused` - 😕
- `heart` - ❤️
- `hooray` - 🎉
- `rocket` - 🚀
- `eyes` - 👀

## Outputs

| Output | Description |
| --------- | --------------------------------------------------------------- |
| `success` | Whether the reaction was successfully added (`true` or `false`) |

## Permissions

The action requires the following permissions:

```yaml
permissions:
contents: read # To read repository content
pull-requests: write # To add reactions and comments to PRs
issues: write # To add reactions and comments to issues
```

## Setup

### 1. Configure Secrets

Add the following secrets to your repository:

- `AUGMENT_API_KEY`: Your Augment API token
- `AUGMENT_API_URL`: Your Augment API URL endpoint

### 2. Create Workflow

Create `.github/workflows/assistant.yml` with the example workflow above.

### 3. Test

Create a test PR and comment with `@augment <your instruction>`. For example:

```
@augment Add error handling to the login function
```

The assistant will:

- React with 👀 to acknowledge
- Gather PR context
- Implement the requested changes
- Commit and push to the PR branch
- Comment with the result

## Example Instructions

- `@augment Add unit tests for the UserService class`
- `@augment Refactor this function to use async/await`
- `@augment Fix the TypeScript errors in this file`
- `@augment Add JSDoc comments to all exported functions`
- `@augment Implement the TODO comments in this PR`

## Troubleshooting

### No changes committed

- Check that Auggie has write access to the repository
- Verify that the PR branch is not protected
- Check the workflow logs for errors

### Auggie fails to connect

- Verify `AUGMENT_API_KEY` and `AUGMENT_API_URL` are set correctly
- Check that the API endpoint is accessible from GitHub Actions

### Changes not appearing

- Ensure the workflow has `contents: write` permission
- Check that the checkout step uses the correct branch reference

## License

MIT
Loading