--- title: GitHub Issue Triage โ€” OpenEnv emoji: ๐Ÿ› colorFrom: blue colorTo: purple sdk: docker app_port: 8000 pinned: true tags: - openenv - reinforcement-learning - nlp - triage - real-world base_path: /web --- # ๐Ÿ› 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. Read an issue title, body, author, and existing comments 2. Assign a **label** (bug / feature / docs / question) 3. Route it to the correct **team** (frontend / backend / ml / devops / docs) 4. Score its **priority** (critical / high / medium / low) 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 | Field | Type | Required | Description | |---|---|---|---| | `label` | `string` | Always | `bug` ยท `feature` ยท `docs` ยท `question` | | `team` | `string\|null` | Medium + Hard | `frontend` ยท `backend` ยท `ml` ยท `devops` ยท `docs` | | `priority` | `string\|null` | Hard only | `critical` ยท `high` ยท `medium` ยท `low` | | `suggested_action` | `string\|null` | Hard only | Brief concrete fix recommendation | | `reasoning` | `string\|null` | Optional | Agent's justification (not graded) | ### Observation Space | Field | Type | Description | |---|---|---| | `issue_id` | `string` | GitHub issue number | | `issue_title` | `string` | Title of the issue | | `issue_body` | `string` | Full issue body | | `author` | `string` | Who filed the issue | | `existing_comments` | `list[str]` | Prior comments (context) | | `task_id` | `string` | Current difficulty: `easy` / `medium` / `hard` | | `task_description` | `string` | What the agent must do this episode | | `last_reward` | `float` | Reward from previous step | | `feedback` | `string` | Grader 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: | Task | Score Range | Typical | |---|---|---| | ๐ŸŸข Easy | 0.0 โ€“ 1.0 | **1.0** โœ… | | ๐ŸŸก Medium | 0.5 โ€“ 1.0 | **0.75** | | ๐Ÿ”ด Hard | 0.6 โ€“ 1.0 | **0.85** | | **Average** | 0.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 | Name | Role | |---|---| | Om Chougule | Team Lead ยท Environment Design ยท Backend | | Shraman Patil | Grader Logic ยท Inference Script | **Team:** Astra.AI **Hackathon:** Meta PyTorch OpenEnv Hackathon ร— Scaler School of Technology **GitHub:** https://github.com/ironman1947/github-issue-triage