CodeMidas: Scaling Agentic Coding RL Environments from Code Itself
Organizations: LLM Core, Xiaomi · Peking University · University of Hong Kong · Renmin University of China
Abstract
Training capable coding agents via reinforcement learning (RL) requires diverse tasks with reliable verifiers. Open-source codebases offer a rich source of such tasks, while existing methods typically rely on development artifacts such as issues and commits, limiting the range of tasks that can be extracted. To better scale RL environments, we present CodeMidas, an agentic pipeline that turns implemented functionality in existing codebases into executable RL environments using source code as its only task-specific input. CodeMidas allocates agentic compute to every stage of environment construction: agents explore implemented functionality to formulate behavioral specifications, construct tests grounded in execution of the original code, and validate and filter candidate tasks through execution checks and repeated solution rollouts. The resulting dataset has 5,545 training tasks from 3,185 open-source codebases spanning 23 programming languages and 15 technical domains. Training MiMo-V2.5 on these tasks with GRPO improves performance on all five diverse benchmarks, covering issue repair (DeepSWE + 11.7%), whole-program construction (ProgramBench +17%), and terminal work (Terminal-Bench v2.1 +8.5%). Ablations show that increasing the number of high-quality training tasks improves performance. Trajectory analysis shows the RL-trained agent demonstrates better behaviors like increasing codebase exploration and more diverse self-verification. These results establish source code as a scalable foundation for constructing RL environments that improve coding agents across diverse software tasks.
Figures & tables
| Method | w/o issue | w/o PR | w/o commit | w/o existing tests | w/o written description | Languages |
| SWE-rebench V2 ( Badertdinov et al., 2026 ) | ✗ | ✗ | ✗ | ✓ | 20 | |
| daVinci-Env ( Fu et al., 2026 ) | ✗ | ✗ | ✗ | ✗ | ✓ | 1 |
| R2E-Gym ( Jain et al., 2025 ) | ✓ | ✓ | ✗ | ✓ | 1 | |
| SWE-smith ( Yang et al., 2025 ) | ✓ | ✗ | ✓ | 1 | ||
| SWE-Flow ( Zhang et al., 2025 ) | ✓ | ✓ | ✓ | ✗ | ✓ | 1 |
| SWE-Hub ( Zeng et al., 2026 ) | ✓ | ✓ | ✓ | ✗ | 11 |
| Behavior | Measure | Early | Late | Change |
| Codebase exploration | Pre-edit read/search calls | 27.2 | 40.1 | +12.9 |
| Code drafting | Drafting ratio | 0.358 | 0.629 | +0.271 |
| Self-verification | Distinct post-edit commands | 2.03 | 2.53 | +0.50 |
| Evaluation | Codebase exploration (read/search calls) | Code drafting (drafting ratio) | Self-verification (distinct commands) | Interaction length (assistant turns) |
| SWE-bench Pro | 23.1 35.5 | 0.304 0.653 | 0.80 0.96 | 37.3 50.1 |
| ProgramBench | 55.7 83.6 | 0.106 0.361 | 0.93 0.99 | 155.1 122.8 |
| Terminal-Bench v2.1 | 11.9 16.8 | N/A | 2.01 2.61 | 59.2 69.5 |
Appendix figures & tables1 asset
Supplementary material from the paper’s appendix.
Appendix
| Setting | Value |
| Initial policy | MiMo-V2.5 |
| Training task pool | 5,545 CodeMidas tasks |
| Algorithm | GRPO |
| Reward | Binary verifier outcome (0 or 1) |
| Advantage normalization by standard deviation | Disabled |
| Batch size | 32 |
LLM Agent Training
Large language model agent training teaches models to plan, use tools, and learn from multi-step interaction with environments.
See all 585 papers