Repository navigation
Conversation
A Harbor task that declares streamable-http MCP servers now has them granted to the agent as required tool accesses on every seed, and the `task_mcp_grants` setting is removed: a task's tools must reach the agent, and an agent that cannot connect fails its seed or first turn rather than running without them. An entry that cannot be granted (stdio, sse) and `skills_dir` keep their handling: they stay in /tmp/.nemo-gym/task.json and are refused to a harness that does not declare supports_task_tool_context. The refusal no longer advises the removed setting. The default Harbor harness, terminus_2_sandboxed_agent, never inspected tool grants at seed, so it would now run MCP tasks without their tools. Its seed refuses a required grant it cannot use with AgentSeedRejectedError, worded as terminus_2_agent's. Signed-off-by: Adil Asif <[email protected]> Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…ts ungranted HarborMCPServer takes any name and any URL string, as Harbor does, but the tool-access schema takes only a name an agent session can address and an absolute http(s) URL. Now that every streamable-http entry is granted, building the grant for such an entry raised a ValidationError that failed the seed of every harness, the oracle and the harnesses that read /tmp/.nemo-gym/task.json included, with a raw pydantic dump as the reason. An entry the schema rejects is now treated as an SSE one is: it is warned about with the schema's reason (once per run for a job-level compose_overlay entry), stays in task.json and is left unreached, so only a harness that does not declare supports_task_tool_context is refused, and the oracle of `gym dataset validate` still takes the task. Signed-off-by: Adil Asif <[email protected]> Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…grant covers The task-folder patterns page still opened with "any other harness is refused" for a task that declares MCP servers, a rule that held while grants were opt-in. Every streamable-http server is now granted, so the page states the grant first and scopes the task.json refusal to a stdio or sse server, a streamable-http entry that is not granted, and skills_dir. Signed-off-by: Adil Asif <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]>
Three Harbor tests asserted the same single-seed grant, and a Terminus test called the private seed method to check what the HTTP seed test can. The parametrized every-harness test now also checks the run is verified, the multi-turn per-step test covers the single-step one, and the Terminus HTTP test names two required grants in sorted order and checks the refusal is logged as an agent seed rejection. Signed-off-by: Adil Asif <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Adil Asif <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
/ok to test f9c28c1 |
|
/review |
svcnvidia-nemo-ci
left a comment
There was a problem hiding this comment.
SHIP
LGTM, no concerns found. I reviewed all 13 changed files and traced grant validation and fallback, overlay and multi-turn seeding, and Terminus rejection through the shared session lifecycle.
Static review only. I did not execute tests or independently verify the reported rollouts.
Review generated by codex. This was a full review. Request a full review with /review reset=true.
Conflicts in terminus_2_sandboxed_agent (app.py, README.md): main added the same refusal of required grants at seed; main's code and message are kept and this branch's duplicate dropped, and its test now expects main's message. The README keeps main's paragraph plus this branch's note that the harbor environment server grants a task's MCP servers as required. Main's mini-SWE sandboxed agent named Harbor's task_mcp_grants setting, which this branch removes; its README, comment and test docstring now say the harbor environment server grants a task's MCP servers as required. No code change there. Signed-off-by: Adil Asif <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Adil Asif <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
Merged Conflicts in No textual conflict, but updated: The resolution is the one the combined end-to-end branch used (all nine SkillEvaluator-related PRs on Tests on the new head (
|
|
/ok to test 668f194 |
|
/review reset=true |
svcnvidia-nemo-ci
left a comment
There was a problem hiding this comment.
SHIP
No correctness defects found. I reviewed all 15 changed files, compared against the previous review, and traced grant construction, task.json fallback, overlay merging, multi-turn sessions and harness rejection. One non-blocking test-maintenance suggestion is inline.
CI: On 668f194b18263392b5f28f6ed522d1ef30aa9e16, Nemo_CICD_Test, lint, all four core shards, combined coverage, sandbox tests and all eight server shards succeeded. The container build, changed-server tests and session-routing end-to-end job were skipped, not passed. Non-blocking compliance flagged unchanged run() methods. Mini-SWE conformance timed out after reporting 762 passed and 14 skipped; neither non-blocking check feeds the final CI aggregate.
Probes: In 766267172432.dkr.ecr.us-east-1.amazonaws.com/gym:main-offline, using Python 3.13.14, purpose-built scripts under /workspace/review-probes/ passed:
mcp_contract_probe.pycompared base and head: valid merged entries became required grants, overlay precedence and URLs were preserved, and invalid/SSE entries stayed unreached.core_mcp_lifecycle.pyexercised fresh and continuation sessions with mixed declarations and seed refusal, including cleanup.mcp_rejection_probe.pyconfirmed terminal refusal versus retryable connection failure, no verifier execution, and agent/sandbox cleanup. I corrected its initial mock to useaiohttp.ClientConnectionError; the corrected run passed.docs-config-probe.pyvalidated the migrated SWE-Interact settings and explicit rejection of all removed setting values.consumers-mcp-bridge.pyexercised source-extracted consumer methods with fakes for grant conversion, refusal and cleanup.
These were narrow mocked probes, not real harness rollouts. I did not rerun CI suites or independently repeat the real-model rollout described in the PR.
Review generated by codex. This was a full review. Request a full review with /review reset=true.
| connect.assert_not_awaited() | ||
| assert "ag-1" not in agent._session_records | ||
|
|
||
| def test_seed_skips_an_optional_tool_grant(self, monkeypatch): |
There was a problem hiding this comment.
NOTE — suggestion: remove this duplicate optional-grant test. The existing test_required_tool_grants_refused_before_connecting already covers required=False, configured=False, kind="mcp" through the same seed endpoint and asserts HTTP 200 plus sandbox connection. This adds another copy to maintain without protecting a distinct behavior.
Could you keep the existing parameterized coverage and remove this test? Keep the new mixed-grant rejection test, which adds useful coverage of the required grant names. After removal, the existing matrix should still cover optional MCP and direct HTTP grants from both configuration and request.
…ed matrix already covers test_required_tool_grants_refused_before_connecting already seeds an optional MCP grant through the same endpoint and asserts a 200 and a sandbox connection, so the separate optional-grant test added nothing. The mixed-grant refusal test stays. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Adil Asif <[email protected]>
|
Addressed the NOTE in |
|
/ok to test 6cd7a66 |
|
/review reset=true |
svcnvidia-nemo-ci
left a comment
There was a problem hiding this comment.
SHIP
No actionable findings. I reviewed all 15 changed files and traced grant construction, task.json fallback, overlay precedence, multi-turn sessions and harness refusal/cleanup. The prior duplicate optional-grant test is removed; the existing parameterized test still covers optional grants.
The removal of task_mcp_grants is deliberate, documented and reflected in SWE-Interact’s configuration. The PR describes representative real-model smoke rollouts. No verifier or reward-aggregation logic changes.
Probes: Focused scripts under /workspace/review-probes/ passed in 766267172432.dkr.ecr.us-east-1.amazonaws.com/gym:main-offline, using Python 3.13.14:
mcp_contract_probe.pycompared base and head, checking required grants, overlay precedence, URL preservation and unsupported-entry fallback.core_mcp_lifecycle.pyandmcp_rejection_probe.pychecked fresh/continuation sessions, terminal refusal versus retryable connection failure, cleanup and no verification after seed failure.docs-config-probe.pyvalidated SWE-Interact settings and rejection of every removed-setting value.consumers-mcp-bridge.pychecked mocked Codex/Pi conversion, Hermes connection enforcement, Terminus refusal and Mini-SWE acceptance/refusal cleanup.
These were narrow mocked probes, not real harness rollouts. I did not rerun CI suites or independently repeat the author’s model rollouts.
CI: In run 45200445668, lint, component locks, all four core shards, sandbox tests, LongMT scoring and server shards 0–5 passed. Combined coverage and server shards 6–7 were still running, so the required aggregate was not yet green. Changed-server and session-routing end-to-end jobs were skipped, not passed.
Non-blocking compliance flagged unchanged run() methods. Non-blocking conformance reported nine Terminus scenario failures and unavailable Mini-SWE results. Mini-SWE’s setup/test step timed out after reporting 762 passed and 14 skipped. I have not attributed the conformance failures to this PR; neither diagnostic workflow feeds Nemo_CICD_Test.
Review generated by codex. This was a full review. Request a full review with /review reset=true.
svcnvidia-nemo-ci
left a comment
There was a problem hiding this comment.
SHIP
LGTM — no concerns found. The admitted head 6cd7a668 is identical to the baseline review #6024144561, so there are no changes since that review. I read the complete 15-file diff and checked grant construction, unsupported-entry fallback, overlay precedence, multi-turn seeding and cleanup. The duplicate optional-grant test is still removed, with the existing parameterized coverage intact.
CI: In run 45200445668, Nemo_CICD_Test, lint, component locks, all four core shards, combined coverage, sandbox tests, LongMT scoring and all eight server shards passed. The container build, changed-server tests and session-routing end-to-end job were skipped, not passed.
Non-blocking compliance and harness-conformance checks are still red. Their reports flag existing run() methods, nine Terminus scenario failures and unavailable Mini-SWE results. Neither diagnostic workflow feeds Nemo_CICD_Test; I have not attributed the conformance failures to this PR.
Local evidence: This follow-up was static. I inspected the retained focused probe scripts and lifecycle/consumer logs rather than rerunning them because the reviewed revision is unchanged. I did not rerun CI suites or independently repeat the author's model rollouts.
Note: formal approval is not available for this request, so this review is posted as a comment only.
Review generated by codex. This was a findings-only review. Request a full review with /review reset=true.
Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Adil Asif <[email protected]>
|
Linked into the MCP grants stack (https://github.com/NVIDIA-NeMo/Gym/stack/6689): always grant a task's MCP servers (#6292) → Claude Code MCP grants (#6349) → stdio and SSE MCP grants (#6350), merged in order. Merged main |
|
/ok to test af77f85 |
|
/review reset=true |
svcnvidia-nemo-ci
left a comment
There was a problem hiding this comment.
SHIP
LGTM — no concerns found. I reviewed all 15 changed files and traced required-grant construction, unsupported-entry fallback, overlay precedence, multi-turn seeding, harness refusal and cleanup. The prior duplicate-test suggestion is resolved; the existing parameterized coverage still checks optional grants.
The removal of task_mcp_grants is deliberate, documented and reflected in SWE-Interact’s configuration. The PR supplies representative real-model rollout evidence. No verifier or reward-aggregation logic changes.
CI: For af77f85c, run 45317794189 shows Nemo_CICD_Test, lint, all four core shards, combined coverage and all eight server shards passing. The container build, changed-server tests and session-routing end-to-end job were skipped, not passed.
The workflow is red because of non-blocking diagnostics: compliance flags unchanged run() methods; conformance reports nine Terminus scenario failures and unavailable Mini-SWE results after a five-minute timeout. Neither diagnostic feeds Nemo_CICD_Test. I have not attributed the conformance failures to this PR.
Local probes: In 766267172432.dkr.ecr.us-east-1.amazonaws.com/gym:main-offline, Python 3.13.14, the focused scripts under /workspace/review-probes/ passed:
- Base-versus-head grant construction, overlay precedence, URL preservation and unsupported-entry fallback.
- Fresh and continuation sessions, terminal refusal versus retryable connection failure, cleanup and no verification after seed failure.
- SWE-Interact configuration loading and explicit rejection of all removed-setting values.
- Mocked consumer conversion, connection enforcement, refusal and Mini-SWE cleanup.
These were narrow mocked probes, not real harness rollouts. I did not rerun CI suites or independently repeat the author’s model rollouts.
Review generated by codex. This was a full review. Request a full review with /review reset=true.
Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Adil Asif <[email protected]>
|
Merged
Tests on the head (
|
|
/ok to test 8f4b545 |
|
/review reset=true |
svcnvidia-nemo-ci
left a comment
There was a problem hiding this comment.
SHIP
LGTM. No concerns found. I reviewed all 15 changed files and traced grant construction, overlay precedence, task.json fallback, fresh and continuation sessions, harness refusal and cleanup. I also checked the previous review; the earlier duplicate-test suggestion is still resolved.
Removing task_mcp_grants is an intentional, documented compatibility break. SWE-Interact drops the setting, and obsolete values fail explicitly rather than being ignored. The PR supplies representative real-model rollout evidence. No verifier or reward-aggregation logic changes.
CI: Run 46071157302, attempt 2 passed Nemo_CICD_Test, all four core shards, combined core coverage and all eight server shards. Lint passed on the admitted head. CI tested merge commit dc7f68e3bb487e9da76db8a458267e9679c291f2, merging this head into 46497a69. The container build, changed-server tests and session-routing end-to-end job were skipped, not passed.
The workflow is red on non-blocking compliance and Mini-SWE conformance checks. Compliance flags existing run() methods. The inspected Mini-SWE log ended at its five-minute timeout without usable scenario results; I have not attributed that result to this PR. Neither diagnostic feeds Nemo_CICD_Test.
Local probes: I used the default-branch CI image 766267172432.dkr.ecr.us-east-1.amazonaws.com/gym:82ded40c139ecf82e8053592f13b40e70f98eef4, with Python 3.13.14 and the admitted source loaded explicitly. No successful head container build was available. The scratch scripts under /workspace/review-probes/ passed:
- Grant conversion, malformed-entry isolation, URL preservation and overlay replacement.
- Ten lifecycle cases plus five overlay/cancellation cases, including terminal refusal, retryable outages, continuation evidence and cleanup.
- Mini-SWE task-context forwarding and refusal, Terminus required-grant rejection, and SWE-Interact configuration validation.
These were controlled CPU probes with mocked sandboxes, HTTP failures and external harness dependencies, not real MCP connections or model rollouts. I did not rerun CI suites or independently repeat the author's model rollouts.
Review generated by codex. This was a full review. Request a full review with /review reset=true.
mpatel31415
left a comment
There was a problem hiding this comment.
Two non-blocking NOTE suggestions with proposed fixes. Eight focused Harbor tests passed. I also reproduced three warnings across three successful episodes for each task-declared stdio/SSE server, using the existing sandbox/agent fakes; the overlay test confirms its job-level entry warns only once.
| problems = "; ".join(f"{'.'.join(map(str, e['loc']))}: {e['msg']}" for e in error.errors()) | ||
| reason = f"the tool grant schema rejects it ({problems})" |
There was a problem hiding this comment.
NOTE — Include the grant-validation reason in the episode failure
Could we preserve this reason and include it when refusing a task on a harness that cannot read task.json? For example, a streamable-http entry named user server or using tools:8000/mcp is skipped here, but the episode only says the harness does not support the task and recommends another harness. Fixing the declaration could let the same harness run it; that explanation currently appears only in server logs.
One option is to return rejection reasons alongside the grants and append the relevant reason when building the unreached refusal / failure_reason, while retaining the existing fallback for harnesses that read task.json. The existing invalid-name and invalid-URL refusal cases could also assert the actionable reason in failure_reason.
| if server.name not in job_entries: | ||
| LOGGER.warning( | ||
| f"{task.task_id}: MCP server {server.name!r} ({server.transport}) cannot be granted; {reason}" | ||
| ) |
There was a problem hiding this comment.
NOTE — Deduplicate warnings for task-declared stdio/SSE servers
Could we warn once per task/server per Harbor environment server instance, analogous to the overlay deduplication below? This branch logs at every agent-session seed even when the harness supports task context and the episode succeeds. With fresh sessions, the volume grows with both evaluation repeats and task steps. Removing the default off early return makes this warning active by default.
I reproduced three successful episodes emitting three warnings for a task-declared sse server, and separately the same result for stdio. The existing test_an_overlay_entry_that_cannot_be_granted_is_warned_about_once_per_run also explicitly expects three task warnings versus one overlay warning. This branch has no platform or connectivity condition.
Since these are valid declarations consumed through task.json, a once-per-task/server warning would preserve the authoring signal without repeating it on every seed; malformed streamable-http declarations can retain their validation warnings.
mpatel31415
left a comment
There was a problem hiding this comment.
There are only two non-blocking NOTE suggestions with proposed fixes. Eight focused Harbor tests passed. I also reproduced three warnings across three successful episodes for each task-declared stdio/SSE server, using the existing sandbox/agent fakes; the overlay test confirms its job-level entry warns only once.
What does this PR do?
A Harbor task's declared MCP servers now always reach the agent. Before, the
harborEnvironment Server grantedthem only when
task_mcp_grantswas set (defaultoff). By default, harnesses that do not read/tmp/.nemo-gym/task.json, such as Codex, Hermes and Pi, were refused the task; with it on, a harness that ignoresgrants could run the task without its tools.
streamable-httpserver in the task's[[environment.mcp_servers]]or the job'scompose_overlayisgranted as required. An agent that cannot connect fails its seed or first turn.
task_mcp_grantsis removed, with no shim: a config that sets it fails to load.swe_interact.yaml, the only onein the repo, drops it.
stdioandsseentries, andstreamable-httpentries whose name or URL the grant schema rejects, are warnedabout and stay in task.json under the existing
supports_task_tool_contextrefusal, which no longer suggests theremoved setting.
terminus_2_sandboxed_agentrefuses required grants with a terminal 422, instead of running without the toolsfor a silent zero.
main(merged at51630ce4f2, then15adc22542) now has the same refusal, so this PR keepsmain's code andmessage and adds only the README note on Harbor tasks.
From their code, the other session harnesses consume MCP grants (Codex, Hermes, Pi, OpenCode, Kilo Code and others)
or refuse required ones at seed (Claude Code, Cline, Goose, OpenHands and others); the oracle and
miniswe_sandboxed_agentignore grants but reach the servers through
solve.shand task.json.No issue filed: a maintainer decided, while running SkillEvaluator task folders on Gym, that a task's declared MCP
servers must always reach the agent. This overlaps the task-skills PR (#6293, for the
skills_dirrefusal issue #5639) inHarbor's
app.pyrefusal block, README and two docs pages; whichever merges second needs a small rebase.Validation
On the head
668f194b18(mainmerged at51630ce4f2in0666e012e2, where the Terminus conflicts were resolved,then at
15adc22542in668f194b18with no conflicts), withgym env test(pytest runs serially, one suite at atime):
environment_servers/harbor: 739 passedterminus_2_sandboxed_agent: 174 passed, 4 failed. The 4 aretest_terminal.pytmux tests (exited-shell recovery and Ctrl-C queue recovery) that cannot reach a tmux server on the test host; they fail the same way onmain15adc22542miniswe_sandboxed_agent: 213 passed. A first run while the host was under heavy load from other work failed 18 native-runner timing tests (test_limits.py,test_worker.py,test_server.py,test_observability.py: timeouts and an empty partial trajectory); this PR changes only a comment, a README line and a test docstring thereBefore those merges, on
f9c28c139(origin/mainmerged atcd899cad5):cd environment_servers/harbor && python -m pytest tests -n 8: 739 passed.cd responses_api_agents/terminus_2_sandboxed_agent && python -m pytest tests -n 4: 166 passed, 4 failed:tmux tests that cannot reach the test host's tmux server, failing the same way with main's
app.py.app.py, 16 of the 52 MCP-related tests intest_app.py,test_compose_overlay.pyandtest_multi_turn.pyfail; with main's Terminusapp.py,test_seed_refuses_a_required_tool_grant_it_cannot_usefails.
pytest tests/unit_tests/test_fern_docs_links.py: 30 passed.pre-commit run --all-filespasses (guardwordsskipped: no local catalog).
swe_interact.yamlloads againstHarborEnvironmentServerConfig; main's version fails withExtra inputs are not permitted.Rollouts
With a real model: a hosted GPT model, via
gym eval run --sandbox opensandbox --model-type openai_modeland adeployment file that only enables sandbox networking. The task
magic_wordhas a Compose sidecar whosestreamable-http MCP tool
get_magic_wordreturnspineapple; it scores 1 only if/tmp/answer.txtholdspineappleand the sidecar logged the call. Its oracle (no model) scored 1.0.codex_agent(Codex 0.144.4): reward 1.0. The sidecar loggedinitialize,tools/listandtools/call:get_magic_word, so Codex's own MCP client used the granted URL.terminus_2_sandboxed_agent: terminal 422 at seed, with no retry and no model request:required tool grants it cannot use: magic. Since the merge withmainat51630ce4f2the message ismain's:Terminus 2 sessions drive only their terminal and cannot use required tool grants: magic.terminus_2_sandboxed_agenton a task with no MCP servers, on the final head: reward 1.0.The
magic_wordruns used247feaee5, the same tree as this branch's45c757e30before an author-email rewrite;its Harbor server and Terminus code match the final head.
Without a model (dummy model URL, readiness timeout 0), on the branch's first two commits before that rewrite,
or on main where noted:
task_mcp_grants=required, Terminuscalled the model without the tool.
codex_agentfailed its first turn before any model call (required MCP servers failed to initialize); with it, Codex andminiswe_sandboxed_agentpassed MCP setup.Terminus is refused that task and a
stdioone with thesupports_task_tool_contextmessage, without the oldhint.
Compatibility and benchmark impact
task_mcp_grants; a config that sets it fails withExtra inputs are not permitted.(retryable for Codex). Terminus, already refused them by default, now fails at seed with
main's required-grant422; use a harness such as
codex_agent.stdio,sseandskills_dirhandling, are unchanged. No benchmark in the repochanges score: SWE-Interact already granted its server as required.
Not tested
main(the combined end-to-end branch, with this PRand the other SkillEvaluator-related PRs on
main51630ce4f2, ran stdio MCP tasks only).Checklist
pre-commit run --all-files) (so CI lint/format checks pass).git commit -s) (so the DCO check passes).🤖 Generated with Claude Code