Manuscript Offprint

arXiv:2610.28069

Training the Whole Agent, Not Just the Model

Lingxiao Tang, Wei Tao, Yiwen Guo, Lingfeng Bao

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

Lingxiao Tang1,∗,†^{1,*,\dagger}, Wei Tao2,†^{2,\dagger}, Yiwen Guo3,‡^{3,\ddagger}, Lingfeng Bao1,‡^{1,\ddagger}

1^{1}Zhejiang University 2^{2}LIGHTSPEED 3^{3}Independent Researcher

lingxiaotang@zju.edu.cn wtao@ieee.org

guoyiwen89@gmail.com lingfengbao@zju.edu.cn

Training coding agents typically updates the policy while keeping the harness fixed. During training, trajectories reveal flawed repair strategies and interaction problems that vary across tasks and change as the policy learns. We introduce HarnessAdapt-RL, which trains the policy and adapts its harness during reinforcement learning. For flawed repair strategies, a frozen teacher generates task-specific mechanism-level skills. For interaction problems recurring across tasks, a separate teacher model evolves tools and hooks, keeping each change only if it improves the observed pass rate or the observed trainable rate without lowering either. The policy trains with the adapted harness, and its new trajectories guide further adaptation. With a 9B base model, HarnessAdapt-RL improves pass@1 over GRPO by 9.8, 12.6, and 6.4 percentage points on SWE-bench Verified, Multilingual, and Pro, and outperforms GRPO with the human-designed OpenHands harness. Gains from mechanism-level skills persist after their removal at evaluation. Re-evolving tools and hooks as the policy changes outperforms freezing early versions. Removing them at deployment, in contrast, costs up to 7.7 percentage points. Training therefore produces a model–harness pair: the trained policy and the evolved tools and hooks, with skills removed at deployment.

Code: github.com/lingxiaotang/HarnessAdapt-RL

Date: October 2026

1 Introduction

A coding agent operates as a model–harness pair: the model selects actions, while the harness provides guidance, tools, and runtime feedback. Agent training typically improves the policy while keeping the harness fixed [1–3]. The harness shapes the interaction trajectories used to update the policy, affecting both the effectiveness of training and the performance of the trained agent [4]. Prior work has explored both harness optimization and training-time guidance. Previous methods optimize the harness while keeping the policy fixed [5–7]. Other methods use skills and training guidance to improve policy learning from trajectories [8–10]. Co-Harness alternates harness updates with supervised fine-tuning on trajectories generated by the improved harness [4].

We study harness adaptation during reinforcement learning for coding agents. During training, trajectories expose flawed repair strategies, such as incorrect diagnoses or fixes that only address symptoms. They also reveal interaction problems, such as failed editing commands, excessive output, or insufficient verification. This evidence can guide changes to skills, tools, and runtime hooks that help alleviate these problems. As the problems vary across tasks and change with the policy, the harness needs to adapt throughout training (Appendix C.3). We therefore ask how to design skills for policy learning, how to design and select tools and hooks as the policy changes, and which harness components to retain at deployment.

To address these questions, we introduce HarnessAdapt-RL, which trains the policy and adapts its harness during reinforcement learning. In our setting, skills are textual guidance supplied to the policy during training. First, we compare three skill-guidance variants and use mechanism-level skills that explain when and why a repair strategy applies without providing concrete answers. A frozen teacher model generates these task-

*Work is done during internship at LIGHTSPEED.

†^{\dagger}Equal contribution: Lingxiao Tang and Wei Tao.

‡^{\ddagger}Corresponding authors: Yiwen Guo (guoyiwen89@gmail.com) and Lingfeng Bao (lingfengbao@zju.edu.cn).

specific skills from training trajectories. Second, a separate teacher model identifies recurring interaction and feedback problems across tasks and proposes changes to tools and hooks. Harness selection considers both task success and the availability of rollouts for policy updates (Section 3.3). Each proposal is kept only if it improves the observed pass rate or the observed trainable rate without lowering either (Appendix B.2). We refer to this process as tool and hook evolution. The policy then trains with GRPO [11] on fresh rollouts using the evolved tools and hooks and skills for assisted tasks. Trajectories from the updated policy guide later proposals. Third, we examine which components should remain at deployment. We evaluate the policy after removing skills and compare performance with and without the evolved tools and hooks.

With a 9B base model, HarnessAdapt-RL improves pass@1 over GRPO by 9.8, 12.6, and 6.4 percentage points on SWE-bench Verified [12], Multilingual [2], and Pro [13]. It also outperforms GRPO training with the human-designed OpenHands harness on all three benchmarks. Under the same base harness, models trained with mechanism-level skills perform best among the three skill-guidance variants when evaluated without skills. Re-evolving tools and hooks as the policy changes outperforms keeping their early versions fixed. Holding the trained policy weights fixed, removing the evolved tools and hooks at evaluation reduces pass@1 by up to 7.7 percentage points. Together, these results show that gains from skills persist after their removal, while the evolved tools and hooks remain necessary for full performance at deployment.

Our contributions are threefold:

• Skill design for policy learning. We compare three skill-guidance variants and find that mechanism-level skills yield the best repair performance after guidance is removed.

• Tool and hook evolution during reinforcement learning. We use current-policy trajectories to propose tools and hooks and select changes using both the pass rate and the trainable rate.

• Training and deploying the model-harness pair. We show that gains from skill guidance persist after its removal, while retaining the evolved tools and hooks at deployment preserves the complete performance.

References (36)