Skip to content
Open
Show file tree
Hide file tree
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
34 changes: 34 additions & 0 deletions .github/workflows/pr-agent.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: PR-Agent
on:
pull_request_target:
types: [opened, ready_for_review, reopened]
issue_comment:
types: [created, edited]

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

jobs:
pr-agent:
runs-on: ubuntu-latest
if: |
(github.event_name == 'pull_request_target' && github.event.action != 'closed') ||
(github.event_name == 'issue_comment' && github.event.issue.pull_request &&
contains(github.event.comment.body, '/describe') ||
contains(github.event.comment.body, '/review') ||
contains(github.event.comment.body, '/improve') ||
contains(github.event.comment.body, '/ask'))
steps:
- name: PR-Agent
uses: codium-ai/pr-agent@v0.38.0
env:
OPENAI_API_KEY: ${{ secrets.DEEPSEEK_API_KEY }}
DEEPSEEK_API_KEY: ${{ secrets.DEEPSEEK_API_KEY }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
github_action_config.auto_describe: "true"
github_action_config.auto_review: "true"
github_action_config.auto_improve: "false"
github_action_config.enable_output: "true"
pr_agent.extra_config: ".pr_agent.toml"
38 changes: 38 additions & 0 deletions .pr_agent.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
[pr_description]
extra_instructions = """
Focus on:
1. What behavior changed (not just what code changed)
2. Backend/platform impact (ROCm, Metal, CPU, NPU)
3. Breaking API or build changes
4. Performance implications
Use bullet points. Keep it under 250 words.
"""

[pr_reviewer]
extra_instructions = """
Prioritize:
1. Thread safety and memory correctness (C++20, raw pointers, HIP streams)
2. Build correctness — CMakeLists.txt changes, new targets, platform guards
3. Error handling — allocation failures, HIP errors, file-not-found?
4. Performance — blocking calls on hot paths, unnecessary copies, missing reserve()
5. Test coverage — do new features have corresponding tests?
6. Backward compatibility — HTTP API, CLI interface, model format?

Ignore minor style nits (naming, formatting) unless they obscure intent.
Flag security issues (buffer overflows, unsanitized inputs) as critical.
"""

[pr_code_suggestions]
extra_instructions = """
Suggestions should be actionable and specific. Avoid generic advice.
Prefer concrete rewrites over abstract critiques.
"""

[pr_questions]
enabled = true

[config]
verbosity_level = 1
model = "deepseek/deepseek-chat"
fallback_models = "openai/gpt-4o"
custom_model_max_tokens = 64000
Loading