RFC 006: Agentic RL through Harness Interception — token-faithful traces for TRL#941
Open
rycerzes wants to merge 1 commit into
Open
RFC 006: Agentic RL through Harness Interception — token-faithful traces for TRL#941rycerzes wants to merge 1 commit into
rycerzes wants to merge 1 commit into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds an RFC for training the policy driving a black-box agent harness (Pi, OpenCode, Claude Code, …) inside OpenEnv by intercepting its LLM calls at an OpenAI-compatible boundary and recording a token-faithful trace —
(prompt_ids, response_ids, loss_mask, response_logprobs, reward)— that TRL consumes viarollout_func.This turns RFC 005's
CLIHarnessAdapter.run_white_boxstub (currentlyNotImplementedError) into a real seam. It is the installed-agent training path — the counterpart to the external-agent pattern TRL's Harbor integration already covers.Design-only RFC PR — no runtime behavior changes.
What's in it
chat_template_utils, prefix-break forking, session-ID-as-API-key auth, synthetic SSE replay, weight-sync fencing, proxy-enforced budgets.Relationship to other work
rfcs/005-agentic-harnesses.md) — reconciles with it, does not parallel it.Note on numbering
Filed as
006, but006is also used by open PRs #794 and #624 — happy to renumber to whatever's free at merge time.cc @burtenshaw @adithya-s-k @sergiopaniego
Note
Low Risk
Documentation-only RFC with no runtime, auth, or training behavior changes in the diff.
Overview
Adds RFC 006 (
rfcs/006-agentic-rl-harness-interception.md), a design-only spec for training black-box CLI harnesses without modifying them.The RFC proposes an interception server that sits on the harness’s OpenAI-compatible HTTP boundary, drives generation on TRL-controlled vLLM with
return_token_idsand rollout logprobs, and emits token-faithful traces (prompt_ids,response_ids,loss_mask,response_logprobs, envreward) for TRL’srollout_funcviaCLIHarnessAdapter.run_white_boxandbuild_harness_rollout_func. It spells out the OpenEnv vs TRL ownership split, aHarnessTracecontract, 15 design decisions (TITO via TRLchat_template_utils, prefix-break forking, session bearer auth, synthetic SSE, weight-sync fencing, rollout budgets, δ diagnostics, config provenance), plus architecture/request-lifecycle Mermaid diagrams and a thinGRPOTrainerwiring example.It extends RFC 005 (fills the
run_white_boxstub) and supersedes draft #864’s message-level seam with a token-level contract. No application code changes in this PR.Reviewed by Cursor Bugbot for commit 45c93d7. Bugbot is set up for automated code reviews on this repo. Configure here.