An OpenEnv-based Reinforcement Learning environment designed to train AI agents to debug Python code automatically.
This project focuses on creating a structured environment where models learn to fix buggy code using feedback-driven rewards.
CodeFixer provides an interactive environment where an AI agent:
- Receives buggy Python functions
- Understands the intended functionality
- Submits corrected code
- Gets evaluated through automated test cases
- Learns using a reward-based feedback system
This setup mimics real-world debugging scenarios and is ideal for training RL-based code assistants.
- ✅ Reinforcement Learning environment (OpenEnv compatible)
- ✅ Automated grading using deterministic test cases
- ✅ Dense reward signals for better learning
- ✅ Modular architecture for adding new tasks
- ✅ Docker support for easy deployment
- Python
- OpenEnv
- FastAPI
- Pytest
- Docker
CodeFixer/
├── env/
│ ├── environment.py # Core RL environment logic
│ ├── models.py # Data models (Observation, Action, Reward)
│
├── tasks/
│ ├── tasks.py # Buggy coding tasks & test cases
│
├── tests/
│ ├── test_env.py # Unit tests for environment
│
├── inference.py # Inference / evaluation script
├── server.py # FastAPI server
├── requirements.txt # Python dependencies
├── Dockerfile # Container setup
├── openenv.yaml # OpenEnv configuration
git clone https://github.com/Swaroop-Haridas/CodeFixer.git
cd CodeFixerpython -m venv venv
source venv/bin/activate # Linux/Mac
venv\\Scripts\\activate # Windowspip install -r requirements.txtdocker build -t codefixer .
docker run -p 8000:8000 codefixerpython inference.pypython server.py-
Environment provides:
- Buggy code
- Problem description
-
Agent submits:
- Fixed Python function
-
Environment evaluates:
- Correctness (test cases)
- Efficiency
- Code validity
-
Reward is computed and returned
Run unit tests using:
pytest- Training RL agents for code debugging
- Building AI coding assistants
- Research in program synthesis & repair
- Educational tools for learning debugging
"Teaching machines to debug code is one step closer to autonomous programming." 🚀