Skip to content

Latest commit

ย 

History

7 Commits

Folders and files

NameName
Last commit message
Last commit date
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿค– AutoDebug AI: Local Autonomous Repair Engine

AutoDebug AI is a fully autonomous, local debugging environment that executes broken code, analyzes runtime signals, and iteratively repairs logic errors without sending a single byte of data to the cloud.

๐Ÿ† Problem Statement Solution

Track: DevForge Problem Statement 4 (Local AI-Supervised Autonomous Debugging Sandbox)

Debugging manually is slow and frustrating. Beginners struggle to interpret stack traces, and fixing one bug often reveals another. AutoDebug AI solves this by implementing a loop that runs entirely on your machine.

Key Features

๐Ÿ”„ Autonomous Repair Loop: Unlike standard chatbots, this system runs your code in a sandbox. If the fix fails, it captures the new error and retries up to 3 times automatically.

โš–๏ธ Visual Side-by-Side Diffs: Instantly see exactly what changed between your broken code and the fixed version.

๐Ÿ”’ 100% Local & Private: Powered by qwen2.5-coder:1.5b via Ollama. No API keys, no cloud latency, full data privacy.

๐Ÿ›ก๏ธ Safety First: Automatically creates .bak backups before applying any patches.

๐Ÿง  Context-Aware: Understands both runtime errors (stderr) and logic errors (wrong stdout) based on user prompts.

๐Ÿ› ๏ธ Tech Stack

Frontend: Streamlit (Python-based Reactive UI)

AI Engine: Ollama (running qwen2.5-coder:1.5b)

Sandbox: Python subprocess with timeout constraints (preventing infinite loops).

Diffing Engine: Python difflib for generating structured patch instructions.

๐Ÿš€ Installation & Setup

Prerequisites

Python 3.8+

Ollama (installed and running)

Step 1: Install Dependencies

pip install streamlit requests

Step 2: Setup Local AI

Make sure Ollama is installed, then pull the lightweight coding model:

ollama pull qwen2.5-coder:1.5b

Step 3: Run the Engine

Start the Ollama server (if not running):

ollama serve

Launch the AutoDebug UI:

streamlit run app.py

๐Ÿ“– How to Use

Select a File: Use the sidebar to choose a Python script from your directory.

Describe the Issue: In the chat box, type the problem (e.g., "This binary search hangs forever" or "Fix the recursion depth error").

Watch the Loop:

The system puts the code in a sandbox.

It detects the error (Crash or Timeout).

It consults the Local AI.

It applies the patch and re-runs the code to verify.

Review: If successful, you see a green "Fix Applied" message and a visual comparison of the changes.

๐Ÿงช Validated Test Cases

We stress-tested the system against the following common bugs:

๐Ÿ”ฎ Future Roadmap

Security Static Analysis: Pre-scan code for dangerous imports (os.system, shutil) before execution.

Multi-File Support: Allow debugging across multiple imported modules.

IDE Extension: Porting the core logic to a VS Code Extension (Prototype CLI available).

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages