[rollout] feat: add native Harbor backend - #271
Draft
JoyboyBrian wants to merge 18 commits into
Draft
Conversation
Codecov Report❌ Patch coverage is 📢 Thoughts on this report? Let us know! |
7 tasks
Admit an agent only when the training path supports it, instead of
admitting a wider eval-only set behind an opt-in flag.
Both controllers expose exactly one model-facing route per rollout,
POST /sessions/{id}/v1/chat/completions (traingate callback_server.py,
monolith eval run_eval.py). Codex and OpenCode speak OpenAI Responses and
Claude Code speaks Anthropic Messages, so reaching that route required an
SDK-side translation gateway that only ever bought eval: their training
blocker is opaque context management, which protocol translation cannot
fix. Real-infrastructure E2E against harbor 0.20.0 also found each of the
three still failing on translation fidelity.
Drop those three bindings and the gateway that existed for them, which
also removes the gateway's per-process route table -- state that could
not survive a multi-worker or multi-replica rollout server.
Keep bring-your-own-agent, and split it by identity channel so the wiring
matches how the agent actually takes configuration:
- custom-chat-completions: in-process agent taking api_base/llm_kwargs
- custom-installed-chat-completions: container-side agent reading
OPENAI_BASE_URL/OPENAI_API_KEY
An environment-wired binding owns only those two variables; every other
variable, including other providers' credentials, passes through, because
a custom loop commonly routes only its policy model to the rollout
endpoint. The import-path guard now resolves against Harbor's own agent
registry rather than the binding table, so a de-registered built-in
cannot be reintroduced by naming its class.
Remove the CLI-version pin: no registered binding sets it now.
JoyboyBrian
marked this pull request as draft
July 31, 2026 08:30
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.
What
NativeHarborBackend: run one native Harbor trial per rollout with local, package, or Git task resolution, bounded concurrency, controller endpoint injection, and Docker, Daytona, and SkyPilot support. NoAgentWorkfloworGraderto write.terminus-2andoracle.custom-chat-completions— in-process agent takingapi_base/llm_kwargscustom-installed-chat-completions— container-side agent readingOPENAI_BASE_URL/OPENAI_API_KEYWhy
Native Harbor backend development paused before the SDK gained the current URL-routed protocol, ATIF persistence, file artifact, output download, and Harbor runtime contracts. This brings the integration forward against the current SDK architecture without losing Harbor's richer native trajectory data.
Why agent admission is training-parity
Earlier revisions of this branch also shipped an SDK-side translation gateway so
codex,opencode, andclaude-codecould be offered as eval-only agents. That has been removed, on evidence gathered against the pinnedharbor==0.20.0wheel and the real controllers:POST /sessions/{id}/v1/chat/completions(traingatecallback_server.py, monolith evalrun_eval.py). Codex and OpenCode speak OpenAI Responses; Claude Code speaks Anthropic Messages.namespacetool type, Claude Code on an unmappedreasoning_effort, OpenCode on inconsistent Responses SSE part IDs.Dropping the three bindings and their gateway removes ~1.7k lines and that hazard, and collapses the support model from "eval set ⊃ train set" to a single admission rule.
An
import_pathagent cannot reintroduce a de-registered built-in: the guard resolves the class against Harbor's own agent registry rather than the SDK's binding table.This PR supersedes #267 with the same backend rebuilt directly on the latest
main. The oldbrian/harborbranch inherited pre-squash commits from #235, which made its comparison againstmainunnecessarily noisy.Tracks OSM-1653.
How to Test
1,911 passed locally.
Beyond unit tests,
terminus-2andoraclewere exercised against the realharbor==0.20.0wheel on Daytona sandboxes, serially and at concurrency 16 (16/16 passing in both cases, with valid ATIF trajectories and non-zero token metrics). Note that unit tests monkeypatchTrialQueue.submit, so they do not by themselves prove the real Harbor path.Known follow-up
The controller API key reaches
terminus-2throughAgentConfig.kwargs["llm_kwargs"]["api_key"], and Harbor serializes that config, so the key is written into each trial'sconfig.json,lock.json,result.json, andagent/trajectory.json. In traingate that key is minted once per training run and shared by every rollout. This predates this PR's final shape and is tracked separately rather than fixed here.Checklist
[module] type: descriptionformat