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
33 changes: 33 additions & 0 deletions .github/workflows/pr-agent.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
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
env:
OPENAI_API_KEY: ${{ secrets.OPENAI_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"
44 changes: 44 additions & 0 deletions .pr_agent.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
[pr_description]
# Keep auto-generated descriptions concise — this is a focused C++ engine,
# not a sprawling monorepo.
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]
# Review focus areas for the MLX engine codebase.
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 (#ifdef __linux__, #ifdef __APPLE__)
3. Error handling — are new code paths handling allocation failures, HIP errors, file-not-found?
4. Performance — blocking calls on hot paths, unnecessary copies, missing reserve() calls
5. Test coverage — do new features have corresponding tests?
6. Backward compatibility — does this break the HTTP API, CLI interface, or model format?

Ignore minor style nits (naming, formatting) unless they genuinely 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 like "consider refactoring."
Prefer concrete rewrites over abstract critiques.
"""

[pr_questions]
# Enable /ask for answering questions about PRs.
enabled = true

[config]
# Verbose logging in CI is fine — it's ephemeral.
verbosity_level = 1
# The model to use — gpt-5-mini for cost efficiency on routine reviews,
# gpt-5 for deeper reviews when someone explicitly requests /review.
model = "gpt-5-mini"
fallback_models = "claude-3-sonnet"
Loading