Back to Articles
TRL recently shipped support for training a coding agent natively with OpenEnv, via the OpenCode harness (see the announcement).
In this post we walk through a concrete example, end to end. We take a real, off-the-shelf coding agent, let it run its own loop against real coding problems, and train it with AsyncGRPO on the exact tokens it produced. Then we go one step further and run every rollout in its own remote Hugging Face sandbox, so the rollouts scale out beyond a single node.
We use OpenCode as the concrete agent, but the architecture is agent-agnostic in principle: any agent that runs in a sandbox and talks to the model over an API whose calls can be captured (today, OpenAI-compatible chat completions) can be trained the same way.
We will cover the architecture, how each rollout runs in a remote sandbox, how to run the whole thing on Hugging Face Jobs, and whether it actually learns.








