A GitLab Duo Agent Platform agent powered by GitLab Orbit that triages stale merge requests, recommends reviewers from the knowledge graph, and files weekly debt reports — automatically.
Your team isn't bad at code review. You're missing infrastructure. MRs stall, contexts evaporate, reviewers get piled on, and eventually that 2-hour feature becomes a 2-week archaeology project.
Nobody deliberately lets MRs rot. It happens in the gap between the tools you have and the process you can realistically maintain.
MR Debt Sentinel runs as a scheduled flow every Monday morning, or on demand from GitLab Duo Chat.
The scanner agent pulls every open MR in your project and enriches each with Orbit context: pipeline status, conflict presence, reviewer load, file ownership from the knowledge graph — not just raw metadata.
Each MR is classified: 🔴 CRITICAL (pipeline failing + conflicts + 14d old), 🟠 HIGH (no reviewer + 7d old), 🟡 MEDIUM (inactive reviewer + 3d old), 🟢 LOW (healthy). No guessing — deterministic criteria applied consistently.
The triage agent applies labels, posts respectful nudge comments tagging Orbit-recommended reviewers (ranked by commit ownership + reviewer load), and never piles on someone already handling 5+ reviews.
The report writer creates a structured GitLab issue every Monday: executive summary, heat map by file area, top-5 oldest MRs, trend vs. last week, and concrete recommended actions with suggested owners.
Age > 14d + pipeline failing + merge conflicts. Structured comment, tracking issue created, escalation to maintainers.
Age > 7d, no reviewer assigned. Orbit identifies the best available reviewer. Nudge comment with rationale posted.
Age > 3d, reviewer assigned but inactive. A friendly reminder — one per 48 hours, never more.
Age < 3d, active reviewer. Label applied only. No comment spam on healthy MRs.
GitLab Orbit maps code, work items, pipelines, deployments, and production signals into a single knowledge graph. MR Debt Sentinel queries it to understand why an MR is stale — not just how long.
When the sentinel recommends a reviewer, it's not picking the first person in CODEOWNERS. It's ranking by: 90-day commit frequency on the changed files, current reviewer load across the project, and last-modified ownership weight.
| Component | Type | Purpose | Trigger |
|---|---|---|---|
mr-debt-sentinel |
Agent | On-demand interactive triage via Duo Chat | Natural language |
mr-debt-weekly-report-flow |
Flow | Scheduled Monday scan → label → report (3-agent pipeline) | Cron + /run-debt-report |
mr-health-check |
Skill | Single-MR health assessment with Orbit data | /mr-health-check !{iid} |
orbit-context-fetch |
Skill | Orbit-powered reviewer recommendation engine | /orbit-context-fetch |
stale-mr-closer |
Skill | Safe, auditable stale MR closure with full comment trail | /stale-mr-closer !{iid} |
Navigate to Explore → AI Catalog → Agents. Search "MR Debt Sentinel". Enable in your top-level group, then in your project.
Run the provided glab snippet to create the six triage labels, or create them manually in Project → Manage → Labels.
Copy AGENTS.md to your project root. Adjust thresholds, protected paths, and tone preferences to match your team culture.
An agent that can act on your repository needs constraints you can trust. These are non-negotiable.
Stale MR closures require explicit auto-close approved confirmation from a human in the current session. The draft comment is always shown first.
Any reviewer with 5+ open review requests is marked as overloaded and skipped. The sentinel never makes the reviewer pile-on problem worse.
MRs on branches matching security/ or cve receive comment-only treatment. No autonomous reassignment on sensitive work.
Any MR labelled do-not-triage is unconditionally skipped in all agent actions. Exempt your WIP/experiment branches permanently.
Before closing, a structured comment is posted with the specific criteria met and a clear path to reopen. Nothing is silent.
Define paths in AGENTS.md that require human-only triage: DB migrations, CI config, CODEOWNERS — the sentinel reports but never acts on them.
Enable MR Debt Sentinel in the GitLab AI Catalog and let Monday morning start with a clean triage report, not a backlog of confusion.