CoolFace
Apppublic

om192006/github-issue-triage

sourceHugging Faceupdated 2mo agoView on Hugging Face
1likes
App README

๐Ÿ› GitHub Issue Triage โ€” OpenEnv Environment

Meta PyTorch OpenEnv Hackathon ร— Scaler School of Technology Team Astra.AI ยท Om Chougule (Lead) ยท Shraman Patil


What is this?

A real-world Reinforcement Learning environment where an AI agent reads GitHub issues and performs structured triage decisions โ€” the exact task that software engineers do dozens of times per day.

The agent must:

  1. 1.Read an issue title, body, author, and existing comments
  2. 2.Assign a label (bug / feature / docs / question)
  3. 3.Route it to the correct team (frontend / backend / ml / devops / docs)
  4. 4.Score its priority (critical / high / medium / low)
  5. 5.Suggest a concrete fix action

This directly trains agents for real developer productivity tools (GitHub Copilot, Linear, Jira auto-assign, etc.).


Environment Design

Action Space

FieldTypeRequiredDescription
labelstringAlwaysbug ยท feature ยท docs ยท question
team`string\null`Medium + Hardfrontend ยท backend ยท ml ยท devops ยท docs
priority`string\null`Hard onlycritical ยท high ยท medium ยท low
suggested_action`string\null`Hard onlyBrief concrete fix recommendation
reasoning`string\null`OptionalAgent's justification (not graded)

Observation Space

FieldTypeDescription
issue_idstringGitHub issue number
issue_titlestringTitle of the issue
issue_bodystringFull issue body
authorstringWho filed the issue
existing_commentslist[str]Prior comments (context)
task_idstringCurrent difficulty: easy / medium / hard
task_descriptionstringWhat the agent must do this episode
last_rewardfloatReward from previous step
feedbackstringGrader feedback explaining the score

Tasks and Grading

๐ŸŸข Easy โ€” Label Assignment

Objective: Assign the correct label to the issue. Grader: 1.0 if correct, 0.0 if wrong. Challenge level: Straightforward for capable LLMs.

๐ŸŸก Medium โ€” Label + Team Routing

Objective: Assign correct label AND route to the correct engineering team. Grader: label (0.5) + team (0.5) โ€” partial credit if one is correct. Challenge level: Requires understanding of org structure and issue context.

๐Ÿ”ด Hard โ€” Full Triage (Label + Team + Priority + Fix)

Objective: Full triage decision โ€” label, team, priority, and a concrete fix action. Grader: label (0.30) + team (0.30) + priority (0.20) + fix quality (0.20) Challenge level: Genuinely challenges frontier models on multi-criteria reasoning.

Reward function design: All rewards are continuous [0.0, 1.0], providing partial credit at every step. The fix suggestion uses keyword-overlap scoring so specificity is rewarded โ€” vague answers get partial credit, precise answers get full.

Baseline Scores (Llama 3.1 8B via HF Router)

Scores vary per run because issues are randomly sampled. Representative results:

TaskScore RangeTypical
๐ŸŸข Easy0.0 โ€“ 1.01.0 โœ…
๐ŸŸก Medium0.5 โ€“ 1.00.75
๐Ÿ”ด Hard0.6 โ€“ 1.00.85
Average0.5 โ€“ 1.0~0.80
Binary easy task depends on which issue is sampled. Medium/Hard benefit from partial credit โ€” the model consistently scores well on label and team fields.

Quick Start

Option 1 โ€” Use the hosted Space

bash
curl -X POST https://om192006-github-issue-triage.hf.space/reset \
  -H "Content-Type: application/json" \
  -d '{"task_id": "easy"}'

Option 2 โ€” Run locally with Docker

bash
git clone https://github.com/ironman1947/github-issue-triage
cd github-issue-triage

docker build -t github-issue-triage:latest .
docker run -d -p 8000:8000 github-issue-triage:latest

# Test
curl -X POST http://localhost:8000/reset -H "Content-Type: application/json" -d '{"task_id": "hard"}'

Option 3 โ€” Run inference script

bash
pip install openenv-core openai
export HF_TOKEN=your_hf_token
export API_BASE_URL=https://router.huggingface.co/novita/v3/openai
export MODEL_NAME=meta-llama/llama-3.1-8b-instruct
export ENV_BASE_URL=https://om192006-github-issue-triage.hf.space

python inference.py

Validate

bash
pip install openenv-core
openenv validate

Project Structure

github-issue-triage/
โ”œโ”€โ”€ inference.py                          # Baseline agent (run me!)
โ”œโ”€โ”€ models.py                             # Typed Pydantic models
โ”œโ”€โ”€ client.py                             # Python client helper
โ”œโ”€โ”€ openenv.yaml                          # OpenEnv spec metadata
โ”œโ”€โ”€ Dockerfile                            # Root Dockerfile
โ”œโ”€โ”€ README.md
โ”œโ”€โ”€ pyproject.toml
โ””โ”€โ”€ server/
    โ”œโ”€โ”€ app.py                            # FastAPI server
    โ””โ”€โ”€ github_issue_triage_environment.py  # Environment + grader logic

Real-World Motivation

GitHub issue triage is a bottleneck in every software team. Issues pile up unlabelled, unassigned, with no priority. Human triagers spend hours per week on this. This environment enables:

  • โ€”Training LLM agents to triage automatically
  • โ€”Evaluating how well a model understands developer context
  • โ€”Benchmarking different models on a grounded, reproducible task

Companies like GitHub, GitLab, Linear, and Jira are actively investing in AI-powered triage โ€” this environment enables RL research directly applicable to that.


Team

NameRole
Om ChouguleTeam Lead ยท Environment Design ยท Backend
Shraman PatilGrader Logic ยท Inference Script

Team: Astra.AI Hackathon: Meta PyTorch OpenEnv Hackathon ร— Scaler School of Technology GitHub: https://github.com/ironman1947/github-issue-triage