Hugging Face has published a recipe for teaching an open model the habits of one particular coding agent. The team froze Qwen3.8-27B and trained a small rank-32 LoRA adapter for each of three harnesses, pi, Hermes Agent and OpenCode, using reinforcement learning inside the harness itself. Under pi on Terminal-Bench 2.1, pass@1 rose from 39% to 55%, and on tasks both versions solved the model wrote about 1.5K tokens instead of 2.9K. If you run an open model behind a fixed agent, that is more finished work per GPU hour.
The harnesses ran exactly as shipped, pinned at pi 1.5.2, OpenCode 2.2.7 and Hermes Agent v0.22.6, with a proxy between agent and vLLM server recording every token for the trainer. TRL's AsyncGRPOTrainer scored each attempt against its siblings on the same task. The reward was the verifier's pass or fail plus a tool-efficiency bonus weighted 0.1, so the model was paid a little for doing less. Training mixed 750 bug-fixing tasks, from bugs injected into Python and Go repositories and from real GitHub issues, with 300 TermGrade terminal tasks. Tasks the base model always or never solved were dropped because they teach nothing; in the team's screening, 171 of 442 survived. Each adapter trained on two Nvidia B200s, one serving the model and one training it.
The policing deserves copying. Every training tool call went through safeagents, a set of regex rules that blocks moves such as tampering with test paths; it checked 1.3M calls and blocked 647. Validation also caught a Terminal-Bench 2.1 verifier that accepted known-wrong answers. An earlier round on smaller LFM models sorted tasks into repair, build, extend and qa. This one sticks to fixing and terminal work, and it shows: on 300 AutomationBench business-workflow tasks in a different agent loop, the adapters stayed within noise of the base model.
Our review of Qwen3.8-27B-pi-adapted covers the pi adapter, including its jump from 39.2% to 64.7% on the hardest SWE-bench Pro tasks. We also review Pi, Hermes Agent and OpenCode, and each gain belongs to its pairing: Hugging Face warns against comparing scores across harnesses, since pi compacts context and the other two do not. The pi adapter still travelled, lifting OpenCode on Terminal-Bench from 44.8% to 54.0%. A merged super-adapter covers all three and, with thinking on, raised the mean across six pairings from 55.5% to 63.5%.
Everything rests on one base model and on harness versions that will change. Nobody has measured how quickly an update to pi's prompts or tool format wears the gain away. Hugging Face ran every evaluation itself, one attempt per task, on 51 and 89 tasks. No one has reproduced the results at full scale, and the few user tests posted so far are too small to settle it. Hugging Face also flags "reasoning leakage": with thinking off, the adapter writes short reasoning-like text before tool calls, so some of the gain is thinking under another name. Treat this as tuning for a workload you already run.