The GitHub Feedback Tool enables zero-cost AI debugging by collecting code review feedback from AI bots on GitHub (primarily Gemini Code Assist) and processing it for mindX to automatically fix.
┌─────────────────┐ ┌──────────────────┐ ┌─────────────────┐
│ Push Code to │───▶│ Gemini Bot │───▶│ Collect │
│ GitHub PR │ │ Reviews (Free) │ │ Feedback │
└─────────────────┘ └──────────────────┘ └────────┬────────┘
│
┌─────────────────┐ ┌──────────────────┐ ┌────────▼────────┐
│ Commit Fixes │◀───│ mindX Applies │◀───│ Process │
│ to GitHub │ │ Fixes │ │ Errors │
└─────────────────┘ └──────────────────┘ └─────────────────┘
gemini-code-assist[bot]) - Primary targetgithub-copilot[bot])coderabbitai[bot])codacy-production[bot])sonarcloud[bot])from tools.github_feedback_tool import GitHubFeedbackTool
from agents.memory_agent import MemoryAgent
memory_agent = MemoryAgent()
feedback_tool = GitHubFeedbackTool(memory_agent=memory_agent)
Collect all AI feedback from GitHub
result = await feedback_tool.execute(
operation="collect_feedback",
repo="owner/repo" # Optional, defaults to current repo
)
List pending errors
result = await feedback_tool.execute(
operation="list_errors",
status="pending"
)
Process errors for mindX to fix
result = await feedback_tool.execute(
operation="process_errors",
auto_fix=True,
limit=10
)
Get statistics
result = await feedback_tool.execute(operation="get_stats")
collect_feedbackfetch_pr_commentsfetch_repo_issueslist_errorsprocess_errorsapply_fixmark_fixedmark_ignoredget_statsexport_errorsclear_processedThe tool automatically categorizes errors:
data/github_feedback/
├── errors.json # All collected errors
├── processed.json # Processed comment IDs
├── fixes.json # Applied fixes history
└── export_*.json # Exported error reports
# In coordinator_agent.py
from tools.github_feedback_tool import GitHubFeedbackTool
class CoordinatorAgent:
async def async_init(self):
# ... existing init ...
self.feedback_tool = GitHubFeedbackTool(memory_agent=self.memory_agent)
async def run_feedback_loop(self):
"""Zero-cost AI debugging loop."""
# Collect feedback
result = await self.feedback_tool.execute(operation="collect_feedback")
# Process errors
errors = await self.feedback_tool.execute(
operation="process_errors",
limit=5
)
# For each error, use simple_coder or other agents to fix
for error in errors.get("errors_to_fix", []):
await self._fix_error(error)
All feedback is logged to MemoryAgent:
feedback_collected: When feedback is gatherederror_ready_for_fix: When an error is processed for fixingThe tool requires the GitHub CLI (gh) to be installed and authenticated:
# Install GitHub CLI
macOS: brew install gh
Linux: see https://cli.github.com/
Authenticate
gh auth login
# 1. Collect feedback after a PR is reviewed
result = await feedback_tool.execute(
operation="collect_feedback",
pr_number=42
)
print(f"Found {result['new_errors']} new errors")
2. List high-severity errors
errors = await feedback_tool.execute(
operation="list_errors",
severity="high"
)
3. Process for fixing
processed = await feedback_tool.execute(
operation="process_errors",
category_filter="import", # Only import errors
limit=5
)
4. Each error in processed["errors_to_fix"] contains:
- error_id: Unique identifier
- file_path: File to fix
- line_number: Line number
- message: Error description
- suggestion: AI's suggestion
- action_required: What to do
- auto_fixable: Whether safe to auto-fix
5. After fixing, mark as complete
await feedback_tool.execute(
operation="mark_fixed",
error_id="gh_12345"
)
Bot identifiers can be customized:
feedback_tool.bot_identifiers = [
"gemini-code-assist[bot]",
"my-custom-bot[bot]"
]