Hugging Face has published a concrete workflow for training a coding agent while the actual agent harness owns the loop.
The August 5 post uses TRL, OpenEnv, and the OpenCode harness. The core idea is “loop-owning”: OpenCode runs its normal tool loop in a sandbox, and TRL trains from the tokens the harness actually produced. The trainer does not drive a simplified copy of the agent interaction.
The setup has four main pieces. Each rollout gets an isolated OpenEnv session with its own filesystem and processes. A transparent proxy captures model calls with token IDs and log probabilities. A hidden-test verifier inspects the final workspace and returns a reward. When the harness finishes, TRL reconstructs training samples from the recorded turns and runs GRPO.
For the remote-sandbox example, Hugging Face runs Qwen3-8B through vLLM and uses Hugging Face Jobs to coordinate the components. The post calls out one operational catch: the trainer and vLLM can use localhost for weight sync, but remote sandboxes need a separate reachable sandbox-vllm-url.
Training the harness, not a copy of the harness
Most coding-agent training examples simplify the loop. The trainer samples actions, parses tool calls, runs tools, and feeds results back. That can teach a model a useful behavior, but it can also train against a loop that differs from the agent people actually run.
Loop-owning changes the unit of training. The harness remains responsible for the session. It chooses tools, writes files, reacts to observations, and stops when it is done. The trainer observes enough of that real interaction to apply reinforcement learning to the tokens that mattered.
That distinction matters for coding agents because the harness is part of the product. Tool schemas, sandbox behavior, filesystem state, hidden tests, retries, error messages, and stop rules shape the model’s behavior. Training outside that environment can miss the behaviors that actually make or break an agent session.
The demo is promising, not a benchmark
Hugging Face reports that a short run using Qwen3-8B over 32 problems moved reward from about 0.27 to about 0.71 over 10 steps, with noisy but upward movement. The post is careful about caveats: remote sandboxes add operational failure modes, and exposing vLLM to sandboxes through a quick tunnel is convenient for a demo but should be replaced with an access-controlled endpoint for serious use.
That makes the post useful as an architecture note rather than a leaderboard claim. It shows the pieces are open and composable: TRL, OpenEnv, OpenCode, remote sandboxes, transparent token capture, and hidden-test rewards.





