AmitSJ/github-issue-triage
๐ GitHub Issue Triage โ OpenEnv Environment
MetaXScaler ร Meta ร PyTorch ร Hugging Face Hackathon 2026 An OpenEnv-compatible reinforcement learning environment where AI agents learn to triage GitHub issues.
   
๐ฏ What This Is
Open-source projects receive thousands of GitHub issues daily โ bugs, feature requests, questions, duplicates. Maintainers spend 4โ8 hours per day just on triage: classifying, prioritizing, routing, and estimating effort for each issue.
This project builds an OpenEnv-compatible RL training environment where AI agents can learn to automate this process. Agents interact with realistic simulated GitHub issues and receive reward signals for making accurate triage decisions.
The core idea:
Agent reads issue โ Makes triage decisions โ Gets reward (0.0โ1.0) โ Learns to improve๐๏ธ Architecture
github-issue-triage-env/
โโโ env/
โ โโโ models.py # Typed Pydantic models (observation + action spaces)
โ โโโ issue_generator.py # 50 realistic synthetic GitHub issues
โ โโโ rewards.py # Partial reward functions (0.0โ1.0)
โ โโโ tasks.py # 3 task definitions + graders
โ โโโ environment.py # Core engine: reset() / step() / state()
โโโ static/
โ โโโ dashboard.html # Visual web UI at /dashboard
โโโ app.py # FastAPI server (exposes HTTP endpoints)
โโโ baseline.py # Rule-based baseline agent
โโโ openenv.yaml # OpenEnv specification config
โโโ Dockerfile # Container configuration
โโโ requirements.txt # Python dependencies๐ฎ The 3 Tasks
Task 3 Scoring Weights
issue_type โ 25%
priority โ 30% (most critical โ wrong priority = wrong escalation)
team โ 30% (most critical โ wrong team = issue ignored)
effort โ 15%๐ Observation Space
What the agent sees each step:
{
"issue_id": "issue_042",
"title": "App crashes on startup after v3.2 update",
"body": "## Bug Report\n1,200 crash reports in 2 hours...",
"repo": "mobile-app",
"author_type": "regular",
"user_reports": 1200,
"existing_labels": [],
"open_issues_count": 340,
"task_id": "task_1",
"step_number": 3
}โก Action Space
What the agent does each step:
{
"issue_type": "bug",
"priority": "P1",
"team": "backend",
"estimated_effort": "small"
}Allowed values:
issue_type:bug|feature|question|documentation|duplicatepriority:P1(Critical) |P2(High) |P3(Medium) |P4(Low)team:backend|frontend|devops|documentation|security|supportestimated_effort:small|medium|large
๐ Reward Function
# Task 1 โ Binary (issue type only)
exact_match โ 1.0 | wrong โ 0.0
# Task 2 โ Weighted average
(type_score ร 0.5) + (priority_score ร 0.5)
# Task 3 โ Fully weighted
(type ร 0.25) + (priority ร 0.30) + (team ร 0.30) + (effort ร 0.15)Partial rewards for priority:
Exact match โ 1.0
1 level off โ 0.5 (P1 vs P2 โ close, partial credit)
2 levels off โ 0.2
3+ levels โ 0.0๐ Quick Start
1. Clone and Install
git clone https://github.com/yourusername/github-issue-triage-env
cd github-issue-triage-env
pip install -r requirements.txt2. Start the Server
python app.pyServer starts at: http://localhost:7860
3. Open the Dashboard
Visit: http://localhost:7860/dashboard
Interactive visual UI โ select a task, start an episode, submit triage decisions!
4. Explore the API
Visit: http://localhost:7860/docs
Swagger UI with interactive API testing for all endpoints.
5. Run Baseline Agent
# In a second terminal (server must be running):
python baseline.py๐ก API Endpoints
Example: Full Episode via API
# 1. Start episode
curl -X POST http://localhost:7860/reset \
-H "Content-Type: application/json" \
-d '{"task_id": "task_3"}'
# 2. Submit action
curl -X POST http://localhost:7860/step \
-H "Content-Type: application/json" \
-d '{
"issue_type": "bug",
"priority": "P1",
"team": "backend",
"estimated_effort": "small"
}'
# 3. Check state
curl http://localhost:7860/state๐ค Baseline Results
The included baseline.py uses simple keyword matching to demonstrate reproducible scores:
A trained RL agent would significantly outperform these baseline scores.
๐ณ Docker
# Build the container
docker build -t github-issue-triage .
# Run the container
docker run -p 7860:7860 github-issue-triage
# Access at http://localhost:7860๐ก Why This Project?
๐ฎ Future Extensions
- ๐ Connect to real GitHub API for live issue data
- ๐ Multilingual issue support (Hindi, Spanish, French)
- ๐ค Multi-agent mode (one classifies, another reviews)
- ๐ Leaderboard for competing agents
- ๐ฎ LLM-powered agent backbone (GPT / LLaMA)
๐ ๏ธ Tech Stack
๐ License
MIT License โ free to use, modify, and distribute.
Built for MetaXScaler ร Meta ร PyTorch ร Hugging Face Hackathon 2026
