Skip to content

feat(harbor): always hand a task's MCP servers to the agent, remove task_mcp_grants - #6292

Open
adil-a wants to merge 10 commits into
mainfrom
adasif/harbor-always-grant-task-mcp
Open

adil-a wants to merge 10 commits into
mainfrom
adasif/harbor-always-grant-task-mcp

Conversation

@adil-a

@adil-a adil-a commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

What does this PR do?

A Harbor task's declared MCP servers now always reach the agent. Before, the harbor Environment Server granted
them only when task_mcp_grants was set (default off). 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 ignores
grants could run the task without its tools.

  • Every streamable-http server in the task's [[environment.mcp_servers]] or the job's compose_overlay is
    granted as required. An agent that cannot connect fails its seed or first turn.
  • task_mcp_grants is removed, with no shim: a config that sets it fails to load. swe_interact.yaml, the only one
    in the repo, drops it.
  • stdio and sse entries, and streamable-http entries whose name or URL the grant schema rejects, are warned
    about and stay in task.json under the existing supports_task_tool_context refusal, which no longer suggests the
    removed setting.
  • terminus_2_sandboxed_agent refuses required grants with a terminal 422, instead of running without the tools
    for a silent zero. main (merged at 51630ce4f2, then 15adc22542) now has the same refusal, so this PR keeps main's code and
    message and adds only the README note on Harbor tasks.
  • Docs: the Harbor pages and the Harbor server, Terminus and SWE-Interact READMEs.

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_agent
ignore grants but reach the servers through solve.sh and 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_dir refusal issue #5639) in
Harbor's app.py refusal block, README and two docs pages; whichever merges second needs a small rebase.

Validation

On the head 668f194b18 (main merged at 51630ce4f2 in 0666e012e2, where the Terminus conflicts were resolved,
then at 15adc22542 in 668f194b18 with no conflicts), with gym env test (pytest runs serially, one suite at a
time):

  • environment_servers/harbor: 739 passed
  • terminus_2_sandboxed_agent: 174 passed, 4 failed. The 4 are test_terminal.py tmux tests (exited-shell recovery and Ctrl-C queue recovery) that cannot reach a tmux server on the test host; they fail the same way on main 15adc22542
  • miniswe_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 there

Before those merges, on f9c28c139 (origin/main merged at cd899cad5):

  • 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.
  • With main's Harbor app.py, 16 of the 52 MCP-related tests in test_app.py, test_compose_overlay.py and
    test_multi_turn.py fail; with main's Terminus app.py, test_seed_refuses_a_required_tool_grant_it_cannot_use
    fails.
  • pytest tests/unit_tests/test_fern_docs_links.py: 30 passed. pre-commit run --all-files passes (guardwords
    skipped: no local catalog).
  • swe_interact.yaml loads against HarborEnvironmentServerConfig; main's version fails with
    Extra inputs are not permitted.

Rollouts

With a real model: a hosted GPT model, via gym eval run --sandbox opensandbox --model-type openai_model and a
deployment file that only enables sandbox networking. The task magic_word has a Compose sidecar whose
streamable-http MCP tool get_magic_word returns pineapple; it scores 1 only if /tmp/answer.txt holds
pineapple and the sidecar logged the call. Its oracle (no model) scored 1.0.

  • codex_agent (Codex 0.144.4): reward 1.0. The sidecar logged initialize, tools/list and
    tools/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 with main at 51630ce4f2 the message is main's:
    Terminus 2 sessions drive only their terminal and cannot use required tool grants: magic.
  • terminus_2_sandboxed_agent on a task with no MCP servers, on the final head: reward 1.0.

The magic_word runs used 247feaee5, the same tree as this branch's 45c757e30 before 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:

  • On main, the Harbor server refused Terminus the MCP task by default; with task_mcp_grants=required, Terminus
    called the model without the tool.
  • Without the sidecar, codex_agent failed its first turn before any model call (required MCP servers failed to initialize); with it, Codex and miniswe_sandboxed_agent passed MCP setup.
  • For a streamable-http URL with no scheme, the oracle warns and scores 1.0 (before the fix: a raw pydantic error).
    Terminus is refused that task and a stdio one with the supports_task_tool_context message, without the old
    hint.

Compatibility and benchmark impact

  • Config break: delete task_mcp_grants; a config that sets it fails with Extra inputs are not permitted.
  • Grant-taking harnesses now run these tasks by default; an unreachable server fails the seed or first turn
    (retryable for Codex). Terminus, already refused them by default, now fails at seed with main's required-grant
    422; use a harness such as codex_agent.
  • Tasks without MCP servers, and stdio, sse and skills_dir handling, are unchanged. No benchmark in the repo
    changes score: SWE-Interact already granted its server as required.

Not tested

  • SWE-Interact end to end (it needs a simulated-user model and image builds); only its config was loaded.
  • Hermes, Pi, OpenCode and the other grant-taking harnesses with a real model.
  • A real-model MCP run on this PR's head after the merges with main (the combined end-to-end branch, with this PR
    and the other SkillEvaluator-related PRs on main 51630ce4f2, ran stdio MCP tasks only).

Checklist

  • I have read the contributing guidelines.
  • The change is focused; unrelated "drive-by" edits are tracked as separate issues/PRs.
  • Tests added or updated and pass locally, or N/A for docs-only / non-code changes (so CI unit/server checks pass when applicable).
  • Documentation added or updated, or N/A with justification.
  • Pre-commit checks pass locally (pre-commit run --all-files) (so CI lint/format checks pass).
  • New source files include the required Apache-2.0 SPDX header (no new source files).
  • All commits have DCO sign-off (git commit -s) (so the DCO check passes).

🤖 Generated with Claude Code

adil-a and others added 5 commits November 17, 2026 00:18
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]>
@copy-pr-bot

copy-pr-bot Bot commented Nov 17, 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.

@svcnvidia-nemo-ci svcnvidia-nemo-ci added feature New capabilities, enhancements, or enablement work area:environment Individual environments, benchmarks, verifiers, and environment-specific resources servers labels Nov 17, 2026
@adil-a

adil-a commented Nov 18, 2026

Copy link
Copy Markdown
Contributor Author

/ok to test f9c28c1

@adil-a

adil-a commented Nov 18, 2026

Copy link
Copy Markdown
Contributor Author

/review

@github-actions

github-actions Bot commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

@svcnvidia-nemo-ci svcnvidia-nemo-ci left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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.

adil-a and others added 2 commits November 22, 2026 22:46
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]>
@adil-a

adil-a commented Nov 23, 2026

Copy link
Copy Markdown
Contributor Author

Merged main into this branch twice: at 51630ce4f2 (merge commit 0666e012e2, with the conflicts below), then at
15adc22542 (merge commit 668f194b18, new head; no conflicts).

Conflicts in 0666e012e2 (both in terminus_2_sandboxed_agent): main added the same seed refusal of required tool grants that
this PR added. main's code and message are kept and this PR's duplicate is dropped, so Terminus now answers "Terminus 2
sessions drive only their terminal and cannot use required tool grants: ..."; this PR's test expects that message. The
README keeps main's paragraph and adds this PR's note that the harbor Environment Server grants a task's MCP servers
as required, so such a task is refused with a terminal 422 that names the grants.

No textual conflict, but updated: main's mini-SWE sandboxed agent named task_mcp_grants: required, which this
PR removes, in its README, a code comment and a test docstring. They now say that the harbor Environment Server
grants a task's MCP servers as required. No code change there.

The resolution is the one the combined end-to-end branch used (all nine SkillEvaluator-related PRs on main
51630ce4f2); this PR's tree at 0666e012e2 is identical to that branch's first merge.

Tests on the new head (gym env test, one suite at a time, no env.yaml in the tree):

  • environment_servers/harbor: 739 passed
  • terminus_2_sandboxed_agent: 174 passed, 4 failed. The 4 are test_terminal.py tmux tests (exited-shell recovery and Ctrl-C queue recovery) that cannot reach a tmux server on the test host; they fail the same way on main 15adc22542
  • miniswe_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 there

@adil-a

adil-a commented Nov 23, 2026

Copy link
Copy Markdown
Contributor Author

/ok to test 668f194

@adil-a

adil-a commented Nov 23, 2026

Copy link
Copy Markdown
Contributor Author

/review reset=true

@svcnvidia-nemo-ci svcnvidia-nemo-ci left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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.py compared base and head: valid merged entries became required grants, overlay precedence and URLs were preserved, and invalid/SSE entries stayed unreached.
  • core_mcp_lifecycle.py exercised fresh and continuation sessions with mixed declarations and seed refusal, including cleanup.
  • mcp_rejection_probe.py confirmed terminal refusal versus retryable connection failure, no verifier execution, and agent/sandbox cleanup. I corrected its initial mock to use aiohttp.ClientConnectionError; the corrected run passed.
  • docs-config-probe.py validated the migrated SWE-Interact settings and explicit rejection of all removed setting values.
  • consumers-mcp-bridge.py exercised 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):

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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]>
@adil-a

adil-a commented Nov 23, 2026

Copy link
Copy Markdown
Contributor Author

Addressed the NOTE in 6cd7a668d: removed test_seed_skips_an_optional_tool_grant. The seed matrix in test_required_tool_grants_refused_before_connecting already covers an optional MCP grant (and a direct HTTP grant) from configuration and request; the mixed-grant refusal test stays. Terminus tool-grant tests: 9 passed; ruff clean.

@adil-a

adil-a commented Nov 23, 2026

Copy link
Copy Markdown
Contributor Author

/ok to test 6cd7a66

@adil-a

adil-a commented Nov 23, 2026

Copy link
Copy Markdown
Contributor Author

/review reset=true

@svcnvidia-nemo-ci svcnvidia-nemo-ci left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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.py compared base and head, checking required grants, overlay precedence, URL preservation and unsupported-entry fallback.
  • core_mcp_lifecycle.py and mcp_rejection_probe.py checked fresh/continuation sessions, terminal refusal versus retryable connection failure, cleanup and no verification after seed failure.
  • docs-config-probe.py validated SWE-Interact settings and rejection of every removed-setting value.
  • consumers-mcp-bridge.py checked 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.

@adil-a
adil-a marked this pull request as ready for review November 24, 2026 00:05
@nemo-automation-bot
nemo-automation-bot Bot requested a review from a team November 24, 2026 00:07
@nemo-automation-bot
nemo-automation-bot Bot requested review from a team November 24, 2026 00:07

@svcnvidia-nemo-ci svcnvidia-nemo-ci left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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.

@yaoyu-33
yaoyu-33 requested a review from mpatel31415 November 24, 2026 01:39
@svcnvidia-nemo-ci svcnvidia-nemo-ci added the needs-review PR is ready for code review and waiting on a reviewer label Nov 24, 2026
@adil-a
adil-a added this pull request to stack #6689 November 24, 2026 03:07
@adil-a

adil-a commented Nov 24, 2026

Copy link
Copy Markdown
Contributor Author

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 17674bec9a bottom up first; no conflicts. This PR is the bottom of the stack, based on main.

@adil-a

adil-a commented Nov 24, 2026

Copy link
Copy Markdown
Contributor Author

/ok to test af77f85

@adil-a

adil-a commented Nov 24, 2026

Copy link
Copy Markdown
Contributor Author

/review reset=true

@svcnvidia-nemo-ci svcnvidia-nemo-ci left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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.

@adil-a

adil-a commented Nov 27, 2026

Copy link
Copy Markdown
Contributor Author

Merged main at 66a0698b3c into this branch (merge commit 8f4b5457bd, now the head; no conflicts).

main changed four files this PR also changes: environment_servers/harbor/app.py and its tests/test_app.py (one
retry of a separate verifier sandbox after a ready timeout; the agentic-vbench harness entries),
agent-interactions/harbor.mdx (the same harness entries) and miniswe_sandboxed_agent/app.py (monotonic deadlines
on the event loop's clock). All merged on their own, in code this PR does not touch; main's MCP_TOOL_ACCESS_NAME_PATTERN is the pattern MCPToolAccess
validates the grants this PR builds against.

Tests on the head (gym env test, serial; no env.yaml in the tree):

  • environment_servers/harbor: 759 passed
  • miniswe_sandboxed_agent: 214 passed
  • terminus_2_sandboxed_agent: 173 passed, 4 failed. The 4 are test_terminal.py tmux tests (exited-shell recovery
    and Ctrl-C queue recovery) that cannot reach a tmux server on the test host; they fail the same way on main
    66a0698b3c in the same venv

@adil-a

adil-a commented Nov 27, 2026

Copy link
Copy Markdown
Contributor Author

/ok to test 8f4b545

@adil-a

adil-a commented Nov 27, 2026

Copy link
Copy Markdown
Contributor Author

/review reset=true

@svcnvidia-nemo-ci svcnvidia-nemo-ci left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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 mpatel31415 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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.

Comment on lines +1738 to +1739
problems = "; ".join(f"{'.'.join(map(str, e['loc']))}: {e['msg']}" for e in error.errors())
reason = f"the tool grant schema rejects it ({problems})"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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.

Comment on lines +1743 to +1746
if server.name not in job_entries:
LOGGER.warning(
f"{task.task_id}: MCP server {server.name!r} ({server.transport}) cannot be granted; {reason}"
)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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.

@github-actions github-actions Bot removed the sla:review-overdue Review response is over the one-business-day SLA label Dec 3, 2026
@mpatel31415
mpatel31415 self-requested a review December 3, 2026 09:34

@mpatel31415 mpatel31415 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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.

This branch has not been deployed

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

Labels

area:environment Individual environments, benchmarks, verifiers, and environment-specific resources servers feature New capabilities, enhancements, or enablement work needs-review PR is ready for code review and waiting on a reviewer risk:high Autobot PR risk: high

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants