Harness Adapters: RL-Trained LoRA for Qwen3.8-27B

General-purpose models are not optimized for the specific agent harness and task distribution you actually run; they target average performance across everything. This post describes a fully reusable recipe for closing that gap: freeze the base model, add a LoRA adapter, and train it with RL inside the exact harness and tasks you care about. The motivating example is Qwen3.8-27B on Terminal-Bench 2.1 with the pi harness: 39% pass@1 with 2.9K tokens per task before, 55% pass@1 with 1.5K tokens after a custom RL-trained adapter. The released artifacts include one specialist adapter per harness (Pi, OpenCode, Hermes Agent) plus a merged super-adapter.

The task pipeline is built on the Hugging Face Hub. Three sources feed it: SWE-smith injects bugs into real Python and Go repositories, SWE-Gym packaged in TaskTrove turns real GitHub issues into Harbor tasks, and Tasksmith generates tasks from merged pull requests chosen to cover the skills in the target benchmarks. Every candidate goes through openenv validate (metadata screening plus semantic checks such as oracle_max, floor_gap, canary_floor, and episode_determinism) and a difficulty check with the base model. Of 1,127 Hub candidates, 858 passed validation; after Qwen3.8-27B attempted each task four times, 171 of 442 scored tasks were qualified, meaning the model solved them on some attempts but not all. The final dataset, harness-hub/agentic-coding-envs, holds 871 tasks from 35 repositories with a per-repository cap of 40. Short training runs on subsets showed that only the validated, qualified task set produced clear learning.

Training uses TRL’s AsyncGRPOTrainer with LoRA attached via all-linear, thinking mode off during rollouts, and a reward combining verifier correctness with a small 0.1 tool-efficiency bonus. A learning-rate sweep found 5e-5 improved training but became unstable, so the final runs used 2e-5. Each adapter was trained on two B200 GPUs, one for vLLM serving and one for training, with the async token budget pushed to fit more groups per optimization step as trajectories got shorter. The final mixture was 750 harness-adapter RL tasks plus 300 termgrade tasks, and the safeagents plugin was in the loop: across the three runs it checked 1.3M tool calls and blocked 647. Training totaled 598 steps, 78,114 samples, and 167M trained tokens.

Evaluation used all 89 Terminal-Bench 2.1 tasks and the 51 hardest SWE-bench Pro tasks, one attempt per task at temperature 0.8 with thinking off, through the same Harbor/OpenEnv stack as training. Comparisons are fair only within a harness, because each harness ships with different defaults. All three specialist adapters beat the base model under their own harness. On SWE-bench Pro (hard 51), pi improves from 39.2% to 64.7% (+25.5 points; 15 newly solved vs 2 lost, p = 0.002), hermes from 29.4% to 43.1%, and opencode from 35.3% to 51.0%. On Terminal-Bench 2.1, pi gains +16.3 points, hermes +14.1, and opencode +6.0 overall, or +13.6 on the 66 tasks that did not choose its checkpoint. On tasks both models solve, the specialists use 56-72% fewer tool calls on SWE-bench Pro and 53-70% fewer on Terminal-Bench. The pi adapter also transfers across harnesses: under OpenCode it matches OpenCode‘s own specialist on Terminal-Bench, and under Hermes it keeps roughly two-thirds of the specialist’s gain.

To build the super-adapter, the three LoRA updates were concatenated along the rank dimension. Their layer-by-layer cosine similarity is only about 0.01-0.02, so the updates are nearly orthogonal and interfere little. Comparing merge weights on Terminal-Bench 2.1, the authors chose 1/2; the released super-adapter uses pi step 160, hermes step 160, and opencode step 150 at that weight. With thinking off, the super-adapter improves on the base model on all six harness-benchmark pairs (mean pass@1 39.5% to 49.0%; 71 newly solved vs 34 lost, p < 0.001). With thinking on, it wins five of six pairs and ties the sixth (mean 55.5% to 63.5%; 67 newly solved vs 37 lost, p = 0.004), with the largest gains on SWE-bench Pro: +16 under hermes and +20 under opencode. It is also much more efficient: 53-73% fewer tool calls and 44-60% fewer tokens per solved task with thinking off, and 31-48% fewer tool calls on SWE-bench Pro with thinking on. The 1/2 weight was chosen using step-120 adapters on Terminal-Bench, so those numbers are slightly optimistic; SWE-bench Pro did not influence the choice. The post recommends using a harness’s own specialist when thinking is off and you serve with one harness; the super-adapter is for multi-harness or thinking-on serving.

On 300 AutomationBench tasks run with AutomationBench’s own agent loop, the adapters stay close to the base model: pi 27.0%, opencode 25.3%, merged 23.7%, hermes 17.7%, versus base 23.0%. The differences are within noise except perhaps Hermes, so RL inside the harnesses neither transfers clearly to that very different setting nor breaks the model. The post closes with an open question: in non-thinking mode the adapted model sometimes emits short text before tool calls that resembles reasoning traces, described as ‘reasoning leakage’ into its thinking version. The authors still consider the results valid under the same conditions, and plan follow-up work on pure thinking and hybrid thinking/non-thinking training. The full recipe, adapters, GGUFs, RL tasks, safeagents plugin, and evaluation trajectories are shared publicly.

Introducing harness adapters: adapt your favorite model to your harness to improve performance and cost

View Original