Skip to content

[diff view] RFC 005 2/4: foundation types - #1

Closed
splusq wants to merge 1 commit into
rfc-005/pr1-harness-package-splitfrom
rfc-005/pr2-harness-foundation-types
Closed

[diff view] RFC 005 2/4: foundation types#1
splusq wants to merge 1 commit into
rfc-005/pr1-harness-package-splitfrom
rfc-005/pr2-harness-foundation-types

Conversation

@splusq

@splusq splusq commented Aug 28, 2026

Copy link
Copy Markdown
Owner

Incremental-diff view for huggingface/OpenEnv#1098.

Review and discussion happen upstream — this PR exists only because cross-fork PRs cannot chain bases, so the upstream one has to target main and its "Files changed" tab includes the PRs beneath it in the stack.

Here the base is rfc-005/pr1-harness-package-split, so Files changed shows exactly this step's diff (commit 01bb0cef) and nothing else.

Not for merging: merging it into the fork would desync the stack.

🤖 Generated with Claude Code

Adds the type layer for wrapping an external agentic harness (Claude Code,
OpenClaw, Codex) as an OpenEnv environment. No runtime behavior yet — this
PR is types plus their unit tests.

- `config.py`: `HarnessConfig` / `HarnessTransport`. `session_timeout_s`
  is documented as bounding ONE conversational turn, per the RFC's
  temporal-semantics section (the field comment in the RFC is ambiguous;
  flagging for reviewer sign-off).
- `events.py`: `HarnessEventType` / `HarnessEvent` / `HarnessResponse`,
  plus `events_to_metadata()`, the sanctioned JSON-safe path for putting
  events into `Observation.metadata` so they survive wire serialization.
- `adapter.py`: `AgenticHarnessAdapter` ABC and its error hierarchy.
- `tools.py`: `resolve_tool_conflicts()` for the RFC's tool-name collision
  rules (`env_` prefixing, error on ambiguity).

Two deliberate deviations from the RFC text, both because the RFC is stale
against the code:

1. The RFC's `ToolDefinition` does not exist; the type is `Tool`
   (`env_server/mcp_types.py`), reused here rather than duplicated. Same
   for `RESERVED_TOOL_NAMES`, which `resolve_tool_conflicts` re-checks as
   defense in depth.
2. `send_message()` is concrete rather than abstract. Streaming is the
   single abstract turn primitive and `send_message()` drains it, which
   removes duplication from every concrete adapter and makes the terminal
   TURN_COMPLETE event an enforced contract instead of a convention.

The ABC is named `AgenticHarnessAdapter` to avoid colliding with the
rollout layer's existing `HarnessAdapter`. Worth discussing whether to
rename the rollout classes instead and reclaim the RFC's plain names --
see the PR description.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@splusq

splusq commented Aug 28, 2026

Copy link
Copy Markdown
Owner Author

Closing: this was only a diff view, and an un-mergeable PR in the list is more confusing than the cumulative diff it was working around. Review happens on the upstream PR.

@splusq splusq closed this Aug 28, 2026
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