Repo Management
The Repo Manager plugin automates common repository maintenance tasks using AI. It listens for PR and issue events, then performs deduplication checks and applies labels automatically.
Features
- PR Triage — When a pull request is opened or reopened, SourceAnt compares it against other open PRs using an LLM and posts a comment if potential duplicates are found.
- Issue Triage — Same deduplication detection for issues, helping maintainers spot duplicate reports early.
- Auto-Labeling — Analyzes the title, body, and diff of new PRs/issues, then applies the most relevant labels from your repository's existing label set.
How It Works
When a pull_request.opened, pull_request.reopened,
issues.opened, or issues.reopened event is received,
the plugin:
- Fetches other open PRs or issues from the repository.
- Sends them to the configured LLM along with the new item for comparison.
- Posts an idempotent comment if duplicates are detected (updates the same comment on subsequent runs).
- Fetches the repository's labels, asks the LLM to suggest appropriate ones, validates them, and applies them.
Configuration
The plugin is disabled by default. Enable it globally via environment variables, or per-repository using the Config model.
Environment Variables
| Variable | Default | Description |
|---|---|---|
REPO_MANAGER_ENABLED | false | Master switch — enable the repo manager plugin globally |
REPO_MANAGER_PR_TRIAGE | true | Enable PR deduplication checks |
REPO_MANAGER_ISSUE_TRIAGE | true | Enable issue deduplication checks |
REPO_MANAGER_AUTO_LABEL | true | Enable auto-labeling for PRs and issues |
Per-Repository Configuration
Settings can be overridden per repository using the Config model. Repository-level
config takes priority over environment variables.
# Example: enable repo manager for a specific repo
Config.set_value("repository", "owner/repo", "repo_manager.enabled", True, "bool")
# Disable PR triage for a specific repo
Config.set_value("repository", "owner/repo", "repo_manager.pr_triage_enabled", False, "bool") | Config Key | Type | Description |
|---|---|---|
repo_manager.enabled | bool | Enable/disable for this repository |
repo_manager.pr_triage_enabled | bool | Enable/disable PR deduplication |
repo_manager.issue_triage_enabled | bool | Enable/disable issue deduplication |
repo_manager.auto_label_enabled | bool | Enable/disable auto-labeling |
Config Resolution Order
Settings are resolved in order of specificity:
- Repository config (Config model entry for the specific repo)
- Environment variable (global default)
- Plugin default (disabled)
GitHub App Permissions
The repo manager requires the following permissions on your GitHub App (in addition to those needed for code reviews):
- Issues: Read & write (for listing issues, posting comments, applying labels)
- Pull requests: Read & write (already required for code reviews)
Duplicate Detection
When checking for duplicates, the plugin compares the new item's title and body against up to 50 existing open items. The LLM analyzes semantic similarity — not just title matching — so it catches duplicates even when they are worded differently.
Duplicate comments are idempotent: if a dedup comment already exists on the PR/issue, it gets updated rather than creating a new one.
Auto-Labeling
The auto-labeling feature only suggests labels that already exist in your repository. It will never create new labels. For PRs, it also considers the diff content to make more accurate suggestions.
Label matching is case-insensitive — if your repo has a label called Bug and the
LLM suggests bug, it will correctly apply Bug.