Add bot comment handler workflow - #246
Conversation
New feature to automatically address review comments from bots (Copilot, CodeRabbit, etc.) using the configured AI coding agent. Components: - reusable-bot-comment-handler.yml: Core logic to collect and dispatch - agents-bot-comment-handler.yml: Consumer repo thin caller template - fix_bot_comments.md: Prompt template for agent - bot-comment-handler.md: Documentation Features: - Agent-agnostic: Uses PR label (agent:codex, agent:claude) to select agent - Multiple triggers: Label, Gate completion, manual dispatch - Smart filtering: Skips resolved threads, threads with human replies - Concurrency-safe: Uses existing pr-meta dispatch mechanism Integration: - Runs in parallel with keepalive for agent PRs - Can be used standalone for one-off PRs via label - Added to sync templates for consumer repos
Automated Status SummaryHead SHA: 8b281ce
Coverage Overview
Coverage Trend
Updated automatically; will refresh on subsequent CI/Docker completions. Keepalive checklistScopeNo scope information available Tasks
Acceptance criteria
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
🤖 Keepalive Loop StatusPR #246 | Agent: Codex | Iteration 0/5 Current State
🔍 Failure Classification| Error type | infrastructure | |
There was a problem hiding this comment.
Pull request overview
This PR adds a comprehensive bot comment handler workflow system that automatically addresses review comments from bots (like Copilot, CodeRabbit, etc.) by dispatching configured AI coding agents to fix them.
Key Changes
- New reusable workflow (
reusable-bot-comment-handler.yml) that collects unresolved bot review comments via GitHub API and dispatches agents - Agent detection based on PR labels (
agent:codex,agent:claude, etc.) with configurable fallback - Multiple trigger mechanisms: manual label (
autofix:bot-comments), automatic Gate completion for agent PRs, and manual dispatch for testing
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 15 comments.
Show a summary per file
| File | Description |
|---|---|
.github/workflows/reusable-bot-comment-handler.yml |
Core reusable workflow that collects bot comments, detects agent from labels, and dispatches agent via comment |
templates/consumer-repo/.github/workflows/agents-bot-comment-handler.yml |
Consumer repo template that resolves PR numbers from different triggers and calls the reusable workflow |
templates/consumer-repo/.github/codex/prompts/fix_bot_comments.md |
Prompt template providing instructions to agents for addressing bot review comments |
docs/bot-comment-handler.md |
Comprehensive documentation covering setup, usage, triggers, and troubleshooting |
.github/workflows/maint-68-sync-consumer-repos.yml |
Added new workflow to the sync list for propagation to consumer repos |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Addressed: - JSON escaping: Use env vars + process.env instead of inline template injection - secrets vs inputs: Changed 'if: inputs.gh_app_id' to 'if: secrets.gh_app_id' - branches-ignore: Removed unsupported filter, added branch check in job logic - concurrency fallback: Added github.run_id fallback for empty PR numbers - shellcheck: Quoted variables, used env vars instead of inline substitution - API error handling: Added try-catch around PR fetch calls - Thread detection: Fixed to check entire thread for human replies - Docs: Removed claims about auto-resolution and issue creation (not implemented) - Output docs: Fixed comment to match actual outputs Skipped: - None - all suggestions were valid
GitHub Actions doesn't allow 'secrets' context in step-level if conditions. The continue-on-error: true handles the case when App credentials aren't provided.
- Add to docs/ci/WORKFLOWS.md reusable workflows table - Add to docs/ci/WORKFLOW_SYSTEM.md primary workflows list - Add expected name mapping to test_workflow_naming.py
|
Status | ✅ no new diagnostics |
Summary
Adds a new workflow system to automatically address review comments from bots (Copilot, CodeRabbit, etc.) using the configured AI coding agent.
Architecture
Components
reusable-bot-comment-handler.ymlagents-bot-comment-handler.ymlfix_bot_comments.mdbot-comment-handler.mdFeatures
agent:codex,agent:claude) to select agent. Switch agents by changing label, no workflow changes needed.autofix:bot-commentslabel (manual, one-off PRs)workflow_dispatch(testing)Integration
@codex(or other agent) commandBot Authors (Default)
copilot[bot]- GitHub Copilot code reviewgithub-actions[bot]- GitHub Actions suggestionscoderabbitai[bot]- CodeRabbit AI reviewUsage
One-off PRs
Add
autofix:bot-commentslabel to any PR with bot review comments.Agent PRs
Automatic - after Gate completes, handler checks for comments and dispatches agent.
Testing
Testing Plan
Documentation
See docs/bot-comment-handler.md for full documentation.