Skip to content

Latest commit

 

History

3 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🪲 BugSquash AgentHub

BugSquash AgentHub is an intelligent debugging assistant that auto-detects, analyzes, and patches Python code errors. It supports full project patching by recursively scanning and fixing all .py files in a zipped codebase.

Project Badge Placeholder Streamlit Cloud Demo


📸 Screenshots

Screenshot 1


🚀 Features

  • 🔍 Auto-analyze Python tracebacks and extract root cause

  • 🧠 Apply intelligent patches for:

    • NameError, TypeError, AttributeError, ZeroDivisionError
    • IndexError, KeyError, FileNotFoundError, ModuleNotFoundError
    • SyntaxError, IndentationError, RecursionError, ValueError
  • 📦 Upload full Python projects as .zip files

  • 🔁 Multi-pass patching: fixes multiple errors across multiple files

  • 🪞 Side-by-side code diffs and patch previews

  • 💾 Download the fully patched project as a .zip


📁 How to Use

  1. Run the app locally (Streamlit):

    streamlit run main.py
  2. Upload any Python project as a .zip with main.py file in it

  3. Click "🚀 Run Project"

  4. The agent will:

    • Analyze errors
    • Suggest intelligent fixes
    • Apply patches to all .py files
    • Retry and re-analyze if errors remain
  5. Download your patched project


🧠 Agent Architecture

  • AnalyzerAgent: Extracts root error type from traceback
  • SearchAgent: Suggests patch strategy based on error
  • PatchAgent: Applies safe code modifications via pattern detection
  • ExecutionAgent: Runs code and captures output/error

📦 Folder Structure

BugSquash-AgentHub/
├── main.py                 # Streamlit frontend
├── agents/
│   ├── analyzer.py         # Error analysis logic
│   ├── search.py           # Error type → patch logic mapping
│   └── patch.py            # Patch generation logic
├── utils/
│   ├── runner.py           # Code execution helpers
│   ├── file_handler.py     # ZIP extract + project traversal
│   └── ui.py               # Diff renderer and UI helpers

✅ Example Errors Automatically Fixed

  • NameError: name 'x' is not defined
  • TypeError: unsupported operand type(s)
  • AttributeError: object has no attribute
  • ZeroDivisionError: division by zero
  • SyntaxError: invalid syntax
  • IndentationError: unexpected indent
  • FileNotFoundError: [Errno 2] No such file or directory

⚠️ Limitations

  • Only Python 3.x projects are supported
  • Does not handle deep semantic bugs (yet! Planned to resolve this is upcoming version)

📄 License

MIT License

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages