Skip to content

fix(ci): align harness conformance checks with capture semantics - #4251

Merged
giuliolovisotto merged 2 commits into
NVIDIA-NeMo:mainfrom
yaoyu-33:codex/fix-harness-conformance
Oct 9, 2026
Merged

giuliolovisotto merged 2 commits into
NVIDIA-NeMo:mainfrom
yaoyu-33:codex/fix-harness-conformance

Conversation

@yaoyu-33

@yaoyu-33 yaoyu-33 commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor

What does this PR do?

Align conformance with #4045: retained HTTP errors belong to an invocation and may have zero or one step reference. Successful policy responses still require a step; compaction calls remain separate. This corrects the P0 check introduced in #4192 without inventing turns for failed HTTP exchanges.

Also pass the configured assistant-message header to the scripted Model Server's capture middleware, matching normal Model Server startup. Tests cover header retention on HTTP success/failure and reject duplicate links or missing ownership.

The OpenCode plugin-loading commit was removed and replaced by the separate shared-runtime PR #4288. This PR only changes conformance checks, probe wiring, their tests and documentation. It is rebased on main 77509af61.

Validation

After removing the plugin-loading commit:

PYTHONPATH=$PWD python -m pytest \
  tests/unit_tests/harness_capabilities \
  scripts/harness_conformance/tests \
  tests/unit_tests/test_harness_conformance_checks.py -q

342 passed, 2 skipped. Full core and all-server suites were not run locally. The all-files pre-commit check passed on the rebased branch before removing the isolated plugin-loading commit.

The fresh four-harness probe run on the rebased branch, before that split, gave OpenCode 5/7, Hermes 7/7, Pi 6/7, Codex 0/7. These are not results for this final split: OpenCode additionally needs the separate plugin setup. Hermes benefits from #4048 now on main. Pi's two provider-error classification unit failures remain separate (#4285); its HTTP-400 health expectation also remains unresolved. Codex retains independent evidence gaps.

No fresh generative-model benchmark is needed for this diagnostic/probe correction. No API migration or reward/scoring change. No new source files; existing licenses retained. All commits have DCO sign-off.

@yaoyu-33 yaoyu-33 added bug Something isn't working area:ci CI workflows, test routing, and repository automation needs-review PR is ready for code review and waiting on a reviewer labels Oct 8, 2026
@copy-pr-bot

copy-pr-bot Bot commented Oct 8, 2026

Copy link
Copy Markdown

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

@yaoyu-33 yaoyu-33 mentioned this pull request Oct 8, 2026
7 tasks done
@yaoyu-33 yaoyu-33 added the complexity:low Localized change in one scope with a small, straightforward review surface label Oct 8, 2026
@giuliolovisotto
giuliolovisotto force-pushed the codex/fix-harness-conformance branch from e8b12df to 2f29cc2 Compare October 9, 2026 10:06
@nemo-automation-bot
nemo-automation-bot Bot requested review from a team October 9, 2026 10:07
@github-actions

github-actions Bot commented Oct 9, 2026 •

Copy link
Copy Markdown
Contributor

Signed-off-by: yaoyu-33 <yaoyu.094@gmail.com>
Signed-off-by: yaoyu-33 <yaoyu.094@gmail.com>
@giuliolovisotto
giuliolovisotto added this pull request to the merge queue Oct 9, 2026
@giuliolovisotto
giuliolovisotto removed this pull request from the merge queue due to a manual request Oct 9, 2026
@github-actions

github-actions Bot commented Oct 9, 2026

Copy link
Copy Markdown
Contributor

🔄 Merge queue validation started! You can track the progress here: https://github.com/NVIDIA-NeMo/Gym/actions/runs/37953189183

@giuliolovisotto
giuliolovisotto added this pull request to the merge queue Oct 9, 2026
@github-actions

github-actions Bot commented Oct 9, 2026

Copy link
Copy Markdown
Contributor

🔄 Merge queue validation started! You can track the progress here: https://github.com/NVIDIA-NeMo/Gym/actions/runs/37953690934

Merged via the queue into NVIDIA-NeMo:main with commit 5572aec Oct 9, 2026
47 of 50 checks passed
yaoyu-33 pushed a commit to yaoyu-33/Gym that referenced this pull request Oct 9, 2026
…#4288)

## What changes

Local OpenCode lacked the correlation plugin already enabled by the
sandboxed adapter, and the adapters separately selected their runtime
versions. Both now use `opencode_agent/runtime.py`: one release pin, one
unchanged JavaScript patch, and one `apply_observability_patch(...)`
function. The sandbox only adds the necessary upload of that same file.
Existing user plugins are preserved; the patch is enabled with
model-call observability.

The shared module is 15 lines. The plugin is moved unchanged. Both YAML
version duplicates are removed, and the CI installer uses the same
default. Configured versions must match the executable, including
preinstalled/cached sandbox binaries. Local version mismatches now raise
an actionable error instead of warning and continuing. Explicit
`opencode_version` overrides remain supported in both adapters; the
default is stock 1.17.11 for the relevant platform.

Split from NVIDIA-NeMo#4251 at Giulio's request. That PR retains the independent
checker and scripted-capture header fixes; it contains no plugin-loading
change. This PR targets main independently. No reward/scoring changes or
binary fork.

## Validation

```bash
PYTHONPATH=$PWD python -m pytest \
  responses_api_agents/opencode_agent/tests \
  responses_api_agents/opencode_sandboxed_agent/tests \
  tests/unit_tests/test_harness_conformance_ci.py \
  scripts/harness_conformance/tests -q
python -m pre_commit run --all-files
git diff --check
```

**302 passed, 2 skipped**; all-files pre-commit passed. Tests cover both
adapters' plugin configuration, preserved user plugins, capture
disabled, the shared CI/default version, actual plugin hooks, and
rejecting mismatched binaries before task execution.

Fresh real-runtime smoke artifacts are in
`/Users/glovisotto/repos/notes/opencode-shared-runtime-20261009/`:

- Local stock OpenCode 1.17.11: 3 calls linked to 3 turns, two shell
tools, reward 1 and `evaluation_completed=true`. The standalone scripted
fixture supplies the normal production assistant-message capture header
(the separate runner fix in NVIDIA-NeMo#4251).
- Docker sandbox, stock Linux OpenCode 1.17.11: injected 503 then two
successes; 3 captured attempts linked to 2 turns, tool executed and
requested marker returned. Plugin comes from the adapter upload, without
manual plugin configuration.
- Live inference smoke in Docker: one completed call and one correctly
linked turn, usage retained. The Llama-3.1-8B response did not match the
requested marker, so the smoke's task assertion failed; only
runtime/correlation validation passed. No SWE-Pro benchmark
qualification is claimed.

Source, scripts, logs and fresh artifacts are retained with the report.
Full core/all-server suites were not run locally. No new dependencies.
New module has the NVIDIA SPDX header; commit has DCO sign-off.

---------

Signed-off-by: Giulio Lovisotto <glovisotto@nvidia.com>
ehosseiniasl pushed a commit to ehosseiniasl/Gym that referenced this pull request Oct 9, 2026
…o#4285)

Pi's SDK cannot recognize context overflow when an explicitly propagated
provider error is wrapped as `{"detail":{"error":...}}`: it reports “400
status code (no body)” instead of the provider message. Its HTTP 400/503
integration tests also omitted the propagation setting required by the
current OpenAI Model Server.

Remove the adapter's extra HTTPException conversion and use the existing
shared Model Server error handler. Selected statuses now retain the
original provider body, including top-level `error.message` and
`error.code`. LiteLLM inherits the same correction. After Chat streaming
sends a keepalive, the terminal SSE error also retains the selected
provider explanation; unselected provider errors remain generic HTTP 500
messages in the stream. The Pi fixture explicitly enables the statuses
it exercises.

The default propagation policy remains opt-in; unselected errors and
exhausted provider retries retain their HTTP 500 behavior.
**Compatibility:** consumers of explicitly propagated OpenAI/LiteLLM
errors must read the original provider body rather than the former
`detail` wrapper. Capture retains that same served body.

Follow-up to NVIDIA-NeMo#3415 and NVIDIA-NeMo#3626; related tracking:
[FEA-461](https://linear.app/nvidia/issue/FEA-461). This addresses the
separate Pi CI failure exposed while validating NVIDIA-NeMo#4251.

Validation on this branch:
- **507 passed**: OpenAI and LiteLLM adapter tests, base Model
Server/Chat and Responses streaming tests, and pinned Pi 0.80.2 SDK
outcome tests. Covers opt-in and default status handling,
Chat/Responses, streaming/nonstreaming, capture, exhausted retries, and
permanent-error handling. A delayed-error regression fails before the
fix; the pinned Pi SDK recognizes HTTP 400 context overflow and HTTP 503
both before and after the first keepalive.
- **Two real local HTTP smokes passed:** Pi SDK → Gym OpenAI Model
Server → fault-injection provider, HTTP 400 context overflow and HTTP
503 service unavailable. Exactly one upstream request per case; Pi
retains each error message and correctly distinguishes context overflow.
No generative-model benchmark run: this is an error-response wire-format
change.
- Full `pre-commit run --all-files` and `git diff --check` passed;
DCO-signed.

```bash
python -m pytest -o addopts= --import-mode=importlib -q \
  responses_api_agents/pi_agent/tests/test_outcome.py \
  responses_api_models/openai_model/tests/test_app.py \
  responses_api_models/litellm_model/tests/test_app.py \
  tests/unit_tests/test_base_responses_api_model.py \
  tests/unit_tests/test_responses_api_model_streaming.py \
  tests/unit_tests/test_chat_completions_streaming.py
```

---------

Signed-off-by: Giulio Lovisotto <glovisotto@nvidia.com>

This branch was previously deployed

1 inactive deployment
public — 85c2af03 Deployed Oct 9, 2026 by copy-pr-bot[bot] via release / finalize / notify #4849
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:ci CI workflows, test routing, and repository automation bug Something isn't working complexity:low Localized change in one scope with a small, straightforward review surface needs-review PR is ready for code review and waiting on a reviewer

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants