Skip to content

Remove the experimental Harbor integration (superseded by OpenEnv) - #6948

Open
adithya-s-k wants to merge 1 commit into
huggingface:mainfrom
adithya-s-k:remove-experimental-harbor
Open

Remove the experimental Harbor integration (superseded by OpenEnv)#6948
adithya-s-k wants to merge 1 commit into
huggingface:mainfrom
adithya-s-k:remove-experimental-harbor

Conversation

@adithya-s-k

@adithya-s-k adithya-s-k commented Aug 27, 2026

Copy link
Copy Markdown
Collaborator

Removes trl.experimental.harbor and everything that hung off it (added in #6018).

Harbor support now lives in OpenEnv — see huggingface/OpenEnv#1036 — and is reached through the environment/harness surface rather than a TRL-side integration. Keeping an in-tree copy means maintaining two paths to the same framework and having to explain which one a reader should use.

The in-tree path was also the more limited of the two. It supported Harbor's external agents only, because TRL had to drive generation turn-by-turn to capture the policy's tokens, logprobs and env mask — which an opaque in-container agent cannot expose. OpenEnv's capture proxy exposes exactly that, so the installed agents Harbor ships become trainable without being reimplemented. #6947 is the replacement example.

Removed

trl/experimental/harbor/ __init__.py, _env.py, _spec.py
examples/grpo_harbor/ script plus the bash, jupyter and terminal_notes harnesses
tests/experimental/test_harbor.py
trl/import_utils.py is_harbor_available()
tests/testing_utils.py require_harbor — defined but never referenced by any test
pyproject.toml the public trl[harbor] extra
docs harbor.md, its _toctree entry, and its rows in example_overview.md and grpo_trainer.md

docs/source/openenv.md said "Two further integrations" and now names only OpenReward.

SECURITY.md is deliberately untouched — its "Safe harbor" section is the legal term, not the framework.

Note

This drops a public extra (trl[harbor]), so it is a breaking change for anyone importing trl.experimental.harbor. Happy to land it as a deprecation first if you'd prefer a release of warning.


Note

Medium Risk
Breaking removal of a public optional extra and experimental API; core GRPO trainers are unchanged, but Harbor users must migrate to OpenEnv.

Overview
Removes the experimental trl.experimental.harbor integration and everything tied to it: HarborSpec / HarborEnv, the examples/grpo_harbor GRPO script and custom harnesses, tests/experimental/test_harbor.py, the trl[harbor] optional extra, and is_harbor_available / require_harbor. Harbor training is expected to go through OpenEnv instead of an in-process TRL path.

Documentation drops harbor.md from the docs toctree and strips Harbor from the examples index, GRPO environment-integration table, and openenv.md (OpenReward is now the only other named environment_factory integration in that guide).

Adds examples/async_grpo_harbor/PR_DESCRIPTION.md as scaffolding for a follow-up AsyncGRPO + OpenEnv Harbor example (capture proxy, loop-owning harnesses); the diff does not include the actual async_grpo_harbor.py script.

This is a breaking change for pip install trl[harbor] and from trl.experimental.harbor import ....

Reviewed by Cursor Bugbot for commit 0729015. Bugbot is set up for automated code reviews on this repo. Configure here.

Removes trl.experimental.harbor and everything that hung off it. Harbor support now lives in OpenEnv
(huggingface/OpenEnv#1036) and is reached through the environment/harness surface rather than through a
TRL-side integration, so keeping an in-tree copy means maintaining two paths to the same framework and
having to say which one a reader should use.

The in-tree path was also the more limited of the two. It supported Harbor's EXTERNAL agents only,
because TRL had to drive generation turn-by-turn to capture the policy's tokens, logprobs and env mask
-- which an opaque in-container agent cannot expose. OpenEnv's capture proxy does expose exactly that,
so the installed agents that ship with Harbor become trainable there without being reimplemented.

Removed:
  trl/experimental/harbor/{__init__,_env,_spec}.py
  examples/grpo_harbor/ (script plus the bash, jupyter and terminal_notes harnesses)
  tests/experimental/test_harbor.py
  is_harbor_available() in trl/import_utils.py, and require_harbor in tests/testing_utils.py
    (defined but never referenced by any test)
  the public trl[harbor] extra in pyproject.toml
  docs/source/harbor.md, its _toctree entry, and its rows in example_overview.md and grpo_trainer.md

docs/source/openenv.md said 'Two further integrations' and now names only OpenReward.
SECURITY.md is untouched: its 'Safe harbor' section is the legal term, not the framework.
@bot-ci-comment

Copy link
Copy Markdown

The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 0729015. Configure here.


## Depends on

**[huggingface/OpenEnv#1036](https://github.com/huggingface/OpenEnv/pull/1036)**, which adds `envs/harbor_env` and the capture layer this example is built on. The PEP 723 header references it by git subdirectory, so the example is not installable until that lands.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Scaffolding file accidentally committed

Low Severity

examples/async_grpo_harbor/PR_DESCRIPTION.md is scaffolding that the file itself says to delete or leave untracked. The directory has no async_grpo_harbor.py and this removal PR does not add that example, so the leftover draft ships as an empty examples folder.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 0729015. Configure here.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 0729015743

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +1 to +2
<!-- PR description for examples/async_grpo_harbor. Scaffolding — delete before pushing, or keep it
untracked. -->

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Remove the tracked scaffold directory

Tracking this scaffold creates an examples/async_grpo_harbor directory even though no corresponding row is added to docs/source/example_overview.md. tests/test_examples_index.py::test_examples_index_matches_folders enumerates every example directory and therefore reports async_grpo_harbor in missing_rows, causing the test suite to fail; delete or keep this scaffold untracked, as its own comment instructs, or add the actual indexed example.

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant