Automated bug fix workflow that fetches GitHub issues, extracts features, generates PRDs, creates fixes, finds reviewers, and prepares patch folders.
BugOut performs 8 automated steps:
- Fetch Comments - Uses
ghCLI to get all issue comments and saves as JSON - Feature Extraction - Uses AI (parser.py style) to extract structured features from comments
- PRD Generation - Analyzes features and generates a Product Requirements Document
- Bug Fix Generation - Uses AI to propose a fix based on the PRD
- Reviewer Check - Uses Yutori API to find competent reviewers from issue commenters
- Patch Folder - Prepares a complete patch folder with all artifacts
- Repo Clone & Agentic Loop - Clones the repo and uses OpenAI to analyze and generate precise code changes
- Patch Creation - Generates actual unified diff patch files and updates the directory
- Python 3.8+
- GitHub CLI (
gh) .envfile in project root with:FASTINO_KEY- For AI inferenceYUTORI_KEY- For reviewer competence checkingOPENAI_HOST- OpenAI API host (e.g.,api.openai.com)OPENAI_MODEL- OpenAI model to use (e.g.,gpt-4o)OPENAI_API_KEY- OpenAI API key (optional for some endpoints)
wxPython- For GUI (optional, see GUI section)
# Install dependencies
pip install requests python-dotenv
# Ensure gh CLI is installed
gh --version
# Create .env file in project root (parent of qwen/)
cat > ../.env << EOF
FASTINO_KEY=your-key
YUTORI_KEY=your-key
OPENAI_HOST=api.openai.com
OPENAI_MODEL=gpt-4o
OPENAI_API_KEY=your-openai-key
EOF# Install all dependencies including wxPython
pip install -r requirements.txt
# Or install wxPython separately:
# Linux (Ubuntu/Debian)
sudo apt-get install python3-wxgtk4.0
# macOS
pip install wxPython
# Windows
pip install wxPythonRun the complete BugOut workflow from command line:
cd qwen
python bugout.py <repo> <issue_number> [output_dir]Examples:
# Basic usage
python bugout.py microsoft/vscode 12345
# With custom output directory
python bugout.py facebook/react 67890 ./my_output
# Show help
python bugout.py --helpLaunch the BugOut graphical interface:
python bugout.py --guiGUI Features:
| Component | Description |
|---|---|
| π Config Panel | Input fields for repo, issue number, output directory |
| π Status Panel | Progress bar, step counter (0/8), Run ID display |
| π Log Panel | Color-coded live output (success/error/warning/info) |
| π±οΈ Control Buttons | Run, Stop, Clear Log |
| π Directory Browser | Browse button for selecting output location |
| π― Visual Indicators | Step-by-step progress with Unicode symbols |
GUI Workflow:
- Enter repository (e.g.,
microsoft/vscode) - Enter issue number (e.g.,
12345) - Optionally select output directory
- Click "π Run BugOut"
- Watch real-time progress in the log panel
- View completion summary with patch folder location
GUI Screenshots:
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β π BugOut - Automated Bug Fix Workflow β
β βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ£
β From bug report to production-ready patch β
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
Repository: [microsoft/vscode________________]
Issue Number: [12345___________________________]
Output Dir: [./bugout_data___________________] [Browse...]
Status: Running
Progress: [ββββββββββββββββββββββββ] 62% Step: 5/8
Run ID: a3f5b2c1
Output Log:
β Step 1 complete: Fetched 15 comments for issue #12345
β Step 2 complete: Extracted features from 16 entries
β Step 3 complete: Generated PRD with 16 reports analyzed
β Step 4 complete: Generated bug fix
β Step 5 complete: Checked 8 reviewers
β Best reviewer: @somecontributor
...
[π Run BugOut] [βΉ Stop] [π Clear Log]
You can also run each step individually:
Step 1: Fetch Comments
python comment_fetcher.py <repo> <issue_number> [output_dir]Step 2: Extract Features
python feature_extractor.py <comments.json> [output_file]Step 3: Generate PRD
python prd_generator.py <bugs_with_features.json> [output_prd.md]Step 4: Generate Bug Fix
python bug_fixer.py <prd.md> <bugs_with_features.json> [output_dir]Step 5: Check Reviewers
python reviewer_checker_wrapper.py <comments.json> <repo> [output_dir] [wait]Step 6: Prepare Patch Folder
python patch_generator.py <output_dir> <prd.md> <bug_fix.patch> <reviewer.json> <comments.json> <bugs_with_features.json>Step 7: Clone Repo & Agentic Loop
python repo_cloner.py <repo> <prd.md> <bug_fix.json|bug_fix.patch> [output_dir]Step 8: Create Patch File
python patch_creator.py <clone_path> <agent_response.json> <output_dir>Each run gets a unique 8-character UUID as its directory name for easy tracking and organization.
bugout_data/
βββ a3f5b2c1/ # β Unique run ID (UUID)
βββ run_metadata.json # Run info: UUID, repo, issue, timestamp
βββ issue_comments.json # Raw issue data from GitHub
βββ bugs_with_features.json # Extracted features
βββ prd.md # Product Requirements Document
βββ prd.analysis.json # Feature analysis JSON
βββ bug_fix.patch # Initial proposed fix
βββ bug_fix.json # Fix details JSON
βββ reviewer.json # Reviewer analysis
βββ agent_response.json # Agentic loop output (Step 7)
βββ generated.patch # AI-generated unified diff (Step 8)
βββ git.patch # Git diff patch (Step 8)
βββ applied_changes.json # Applied changes log (Step 8)
βββ temp/ # Temp directory with repo clone
β βββ microsoft_vscode_clone/ # Cloned repository
βββ repo_snapshot/ # Snapshot of modified repo
βββ patch/ # Complete patch folder
βββ prd.md
βββ bug_fix.patch
βββ reviewer.json
βββ issue_comments.json
βββ bugs_with_features.json
βββ analysis.json
βββ bug_fix.json
βββ agent_response.json
βββ generated.patch
βββ git.patch
βββ applied_changes.json
βββ patch_manifest.json # Includes run_id reference
Each run creates a run_metadata.json file:
{
"run_id": "a3f5b2c1",
"repo": "microsoft/vscode",
"issue_number": "12345",
"timestamp": "2026-02-27T10:30:00.000000",
"output_dir": "./bugout_data/a3f5b2c1"
}Product Requirements Document containing:
- Executive summary
- Frequency analysis of bug characteristics
- Technical details from user reports
- Functional and non-functional requirements
- Success criteria
Proposed fix containing:
- Root cause analysis
- Fix description
- Code changes
- Testing instructions
Reviewer analysis containing:
- List of all commenters
- Competence assessment for each
- Best reviewer recommendation
Output from the agentic loop containing:
- Root cause analysis
- Affected files list
- Fix strategy
- Detailed code changes with line numbers
- Testing recommendations
- Confidence score
Unified diff patch file containing:
- All code changes from the agentic loop
- Proper diff format for easy review
- Can be applied with
git applyorpatch
Git-formatted patch from the actual repository changes:
- Generated from
git diff HEAD - Ready for
git amor PR creation
Log of all applied changes containing:
- List of changes with success/failure status
- Analysis summary from the agent
- Testing instructions
- Confidence score
| Variable | Description | Required |
|---|---|---|
FASTINO_KEY |
API key for AI inference | Yes |
YUTORI_KEY |
API key for Yutori reviewer check | Yes |
OPENAI_HOST |
OpenAI API host (e.g., api.openai.com) |
Yes |
OPENAI_MODEL |
OpenAI model to use (e.g., gpt-4o) |
Yes |
OPENAI_API_KEY |
OpenAI API key | Optional |
The .env file should be in the parent directory (project root).
l __ __
. . / / __ _____ ____ __ __/ /_
\ / / _ \/ // / _ `/ _ \/ // / __/
`/ ! \` /_.__/\_,_/\_, /\___/\_,_/\__/
| o:o | /___/
~| o:o |~
/ \_:_/ \
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β π BugOut - Automated Bug Fix Workflow β
β βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ£
β From bug report to production-ready patch β
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
Configuration
Run ID: a3f5b2c1
Repository: microsoft/vscode
Issue: #12345
Output: ./bugout_data/a3f5b2c1
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β [1/8] π Fetching issue comments
β
Step 1 complete: Fetched 15 comments for issue #12345
β [2/8] βοΈ Extracting features from comments
βοΈ Processing 16 text entries...
β
Step 2 complete: Extracted features from 16 entries
β [3/8] π― Generating PRD
β
Step 3 complete: Generated PRD with 16 reports analyzed
β [4/8] π Generating bug fix
β
Step 4 complete: Generated bug fix
β [5/8] β
Checking reviewer competence
β
Step 5 complete: Checked 8 reviewers
β
Best reviewer: @somecontributor
β [6/8] π Preparing initial patch folder
β
Created: ./bugout_data/a3f5b2c1/patch
β [7/8] π Running agentic loop with OpenAI
π Cloning microsoft/vscode...
β
Clone: ./bugout_data/a3f5b2c1/temp/microsoft_vscode_clone
β Agent response: ./bugout_data/a3f5b2c1/agent_response.json
β [8/8] β¨ Generating actual patch file
Applying 3 changes...
β
Generated: ./bugout_data/a3f5b2c1/generated.patch
β
Updated: ./bugout_data/a3f5b2c1/patch
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
π BugOut Complete!
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β BugOut Summary β
β βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ£
β Run ID: a3f5b2c1 β
β Repository: microsoft/vscode β
β Issue: #12345 β
β Patch Folder: ./bugout_data/a3f5b2c1/patch β
β Best Reviewer: @somecontributor β
β βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ£
β Generated Artifacts: β
β β’ prd.md (Product Requirements Doc) β
β β’ bug_fix.patch (Initial Proposed Fix) β
β β’ generated.patch (AI-Generated Patch) β
β β’ git.patch (Git Diff Patch) β
β β’ reviewer.json (Reviewer Analysis) β
β β’ agent_response.json (Agentic Loop Output) β
β β’ applied_changes.json (Applied Changes Log) β
β βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ£
β Next Steps: β
β 1. Review PRD: cat ./bugout_data/a3f5b2c1/prd.md β
β 2. Review patch: cat ./bugout_data/a3f5b2c1/patch/ β
β generated.patch β
β 3. Contact reviewer: @somecontributor β
β 4. Create PR with the generated patch β
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
qwen/
βββ bugout.py # Main CLI orchestrator (8 steps)
βββ bugout_gui.py # wxPython graphical interface
βββ comment_fetcher.py # Step 1: Fetch issue comments
βββ feature_extractor.py # Step 2: AI feature extraction
βββ prd_generator.py # Step 3: Generate PRD
βββ bug_fixer.py # Step 4: Initial bug fix
βββ reviewer_checker_wrapper.py # Step 5: Yutori reviewer check
βββ patch_generator.py # Step 6: Initial patch folder
βββ repo_cloner.py # Step 7: Clone repo + agentic loop
βββ patch_creator.py # Step 8: Generate unified diff
βββ requirements.txt # Python dependencies
βββ README.md # This file
MIT