Repository navigation
Conversation
…ants branch This branch builds on it: Claude Code consumes the stdio and SSE grants through the same per-session --mcp-config file. Signed-off-by: Adil Asif <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]>
An MCP tool grant could only name a streamable HTTP endpoint. Harbor tasks also declare stdio servers (a command the agent's MCP client starts) and SSE servers, and SSE is Harbor's default transport for an entry with a URL. MCPToolAccess.connection is now a union discriminated on `transport`: the unchanged MCPStreamableHTTPConnection, a new MCPSSEConnection (url, headers) and a new MCPStdioConnection (command, args, env). A connection without a transport still reads as streamable HTTP. The contract docstring says a stdio server lives with the harness's session and that adapters stop nothing remote. Three helpers let adapters handle the transports alike: mcp_grants_over() keeps the MCP grants over the transports a harness speaks, unusable_required_grants() names the required grants it must refuse at seed (as `name (transport)`), and mcp_server_urls() gives the hosts a restricted sandbox network must allow (a stdio server needs none). Signed-off-by: Adil Asif <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]>
…refuse them where unsupported Each harness that consumes MCP grants now reads the grant's transport instead of assuming a URL. - claude_code_agent: `stdio` and `sse` servers in the session's --mcp-config, beside `http` ones. - codex_agent: a stdio grant becomes a config.toml `command` entry; Codex 0.144.4 has no SSE client, so a required SSE grant is refused at seed and an optional one is left out with an `mcp_server_skipped` gap. Startup stderr redacts a stdio grant's env values as it redacts headers. - opencode_agent: with OpenCode 1, a stdio grant becomes a `local` server and an SSE grant a `remote` one (OpenCode 1 tries streamable HTTP, then SSE). OpenCode 2 sessions keep streamable HTTP only and refuse the others. - hermes_agent: a stdio grant becomes a `command` entry; the pinned Hermes client has no SSE transport, so SSE is refused. - pi_agent: gym_mcp.mjs gains a stdio transport (newline-delimited JSON-RPC to a child process it starts, answering the server's pings). The child holds Pi's event loop only while a request waits, is killed when Pi exits, and is stopped when its setup fails. SSE is refused. - mini_swe_agent: its MCP CLI already speaks every transport; a grant now passes its connection's own fields. - kilocode_agent, openclaw_agent, crewai_agent, openhands_agent: refuse a required stdio or SSE grant at seed with a 422 that names it and its transport, and leave an optional one out, instead of failing on the missing URL. A stdio server runs in the sandbox beside the CLI, so it opens no host under `network_access`. Signed-off-by: Adil Asif <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]>
The harbor Environment Server granted only `streamable-http` entries of [[environment.mcp_servers]]; a `stdio` or `sse` entry (SSE is Harbor's default transport) was warned about and reached only harnesses that read /tmp/.nemo-gym/task.json, so CLI harnesses were refused such tasks. Every entry is now a required grant over its own transport, as Harbor hands its agents the list: a stdio entry as its command and args, which the harness's MCP client starts inside the task sandbox as the agent user (Harbor's option of letting the CLI launch the server, rather than a bridge in the environment server), an SSE entry as its URL. Harbor's MCP server entry has no env or header field (0.22), so a grant carries neither and no task secret is involved. An entry the grant schema rejects is still warned about and left to task.json. Signed-off-by: Adil Asif <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ates The test that checks a started stdio server is stopped when another required server fails setup made its pid-file directory with mkdtempSync and never removed it, so each run left one gym-mcp-pid-* directory in TMPDIR. It now registers t.after to remove it, as the other temp directories in the file do. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Adil Asif <[email protected]>
|
/ok to test 5f2531e |
|
/review |
svcnvidia-nemo-ci
left a comment
There was a problem hiding this comment.
SHIP WITH CARE
I found one RISK: Hermes rejects an optional SSE grant that its runtime would otherwise skip. I also found one NOTE: the Claude Code README recommends a deleted Harbor setting.
I reviewed all 59 changed files and traced the affected grant, configuration and process-lifecycle paths. This was a static review; I did not execute tests.
Inline comments (escaped v1):
-
responses_api_agents/hermes_agent/app.pyline 450: RISK: Filter unsupported optional grants before checking toolset collisions.A valid Hermes seed containing
{"kind":"mcp","name":"terminal","required":false,"connection":{"transport":"sse","url":"http://memory:9000/sse"}}returns HTTP 422 for a toolset collision. This grant should be skipped: the activation path filters SSE out before configuring Hermes. The collision check still examines every MCP grant, so an unused optional server prevents an otherwise valid episode from starting.Could you restrict this comprehension to grants Hermes keeps?
access.name for access in mcp_grants_over(tool_accesses, HERMES_MCP_TRANSPORTS) if access.name in TOOLSETSThis keeps required SSE rejection in
unusable_required_grantsand keeps collision rejection for supported stdio and streamable-HTTP grants, whether required or optional. Only unsupported optional grants bypass the collision check.Proposed acceptance checks: seed an optional SSE grant named
terminaland assert initialization succeeds and the runner configuration omits it. Keep the supported requiredterminalrejection in the existing collision test; add equivalent rejection cases for optional streamable-HTTP and stdio grants. Required SSE must still return 422 naming its transport. I have not executed these checks. -
responses_api_agents/claude_code_agent/README.mdline 360: NOTE: Remove the instruction to set the deleted Harbor option.Following this paragraph and setting
task_mcp_grants: requirednow prevents Harbor from loading. This PR removes the field, and the configuration regression test explicitly expectsValidationErrorfor that setting. Task MCP servers are now granted as required automatically.Could you replace the sentence beginning “The
harborEnvironment Server refuses” and ending “task_mcp_grants: required” with:The
harborEnvironment Server always grants a task's MCP servers as required. Thetask_mcp_grantssetting has been removed and must be omitted.Keep the surrounding distinction between optional failures producing
mcp_server_skippedand required failures failing the activation. Keep the earlier network guidance: required HTTP/SSE grants needmodel_and_toolsfor an agent-owned restricted sandbox, while stdio needs no tool host.Acceptance: inspect the README to confirm it no longer recommends either value of
task_mcp_grants. Keep the existing test's assertion that the removed key is rejected. This is a proposed source check, not an executed test.
Review generated by codex. This was a full review. Request a full review with /review reset=true.
…figures An optional SSE grant is left out at activation, so its name cannot shadow a Hermes toolset; checking it refused an otherwise valid seed. Also drops the Claude Code README's advice to set the removed task_mcp_grants setting. (Review findings on this PR.) Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Adil Asif <[email protected]>
|
Addressed the review in f36e207:
|
|
/ok to test f36e207 |
|
/review reset=true |
svcnvidia-nemo-ci
left a comment
There was a problem hiding this comment.
SHIP
I found no qualifying issues in this full review. I reviewed all 59 changed files and traced the affected grant, configuration and process-cleanup paths.
Both earlier findings are fixed: Hermes filters unsupported optional grants before checking toolset collisions, and the Claude Code README no longer recommends the removed Harbor setting.
This was a static review. I did not execute tests or independently reproduce the reported rollouts.
Review generated by codex. This was a full review. Request a full review with /review reset=true.
…grants branch The always-grant branch now includes origin/main (51630ce), so this brings main in. Conflicts and how they were resolved: - claude_code_agent (app.py, sandbox.py, README.md, require_mcp_servers.sh, tests/test_mcp_grants.py): the same resolution as the Claude Code MCP grants branch's merge of main (main's instruction_on_stdin, system dependencies and client env next to the MCP grants; the wrapper keeps stdin for the backgrounded CLI). - hermes_agent/app.py: the toolset collision check keeps this branch's filter (only grants Hermes configures) and main's builtin_toolsets() source. Main moved payload building into _worker_payload, so the stdio/streamable-HTTP filter of the MCP grants moved to its caller. - hermes_agent/tests/test_app.py: main's renamed weather-v1.0 grant plus this branch's stdio and optional SSE grants. - hermes_agent/README.md: this branch's stdio/streamable-HTTP text with main's MCP tool naming for Hermes v0.23.2. - opencode_agent (app.py imports, tests/test_opencode2_session.py): both sides' imports and tests kept. - add-or-update-a-harness.mdx and terminus_2_sandboxed_agent/README.md: both sides' text kept. Signed-off-by: Adil Asif <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]>
…E MCP grants branch Brings the Claude Code test fixes that branch needed on current main (the fake sandbox's sandbox_id, and required_mcp_servers in main's run_runner payload). The only conflict, the harness table in add-or-update-a-harness.mdx, keeps this branch's per-transport rows. Signed-off-by: Adil Asif <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]>
The comment above HERMES_MCP_TRANSPORTS, the 422 for a required SSE grant and the Hermes row of the harness table said the pinned Hermes MCP client has no SSE transport. Main's Hermes pin (v0.23.2, ae2a81ccc00e) does have one (`transport: sse` in tools/mcp_tool_transport.py). The behavior is unchanged: Gym still refuses a required SSE grant for Hermes and leaves an optional one out; the texts now say that Gym does not configure SSE grants for Hermes yet, as the README already does. Signed-off-by: Adil Asif <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]>
…grants branch The always-grant branch now includes origin/main (15adc22), so this brings that main as well. No conflicts. Signed-off-by: Adil Asif <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]>
…E MCP grants branch The Claude Code MCP grants branch now includes origin/main (15adc22), which this branch already has. No conflicts. Signed-off-by: Adil Asif <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
Updated with
Conflicts in
In Fix These resolutions are the ones the combined end-to-end branch used (all nine SkillEvaluator-related PRs on Tests on the new head (
|
|
/ok to test 242946f |
|
/review reset=true |
svcnvidia-nemo-ci
left a comment
There was a problem hiding this comment.
SHIP WITH CARE
I reviewed all 62 changed files against the admitted base, including the grant producers, adapter consumers, tests and documentation. The earlier Hermes optional-grant collision fix and Claude Code README correction are still present. I found one narrow RISK: supplementary Unicode in the new Codex stdio fields produces invalid TOML.
CI evidence on 242946fc461b6fa825b12a3fa7731187ab2c1efd: Lint check, Unit tests / Test, all eight server-suite shards, sandbox tests and session-routing end-to-end passed. Build Gym container was skipped. The non-blocking compliance check reported existing run() declarations. The non-blocking mini-SWE conformance job timed out during its validation step, so its scenario results are unavailable.
I ran purpose-built probes on 766267172432.dkr.ecr.us-east-1.amazonaws.com/gym:main-offline, using Python 3.13.14 and Node 22.15.0. Harbor grant conversion and seed round-trips passed for all three transports. Adapter probes preserved arguments, environment values and required/optional filtering. Pi probes passed concurrent-response correlation, late-response isolation and child cleanup. The Codex configuration probe reproduced the finding below; the Claude required-server failure probe stopped promptly. Final Python probes explicitly loaded the admitted source after correcting initial import and fixture mistakes. I did not rerun CI suites or independently repeat the author's model rollouts.
Inline comments (escaped v1):
-
responses_api_agents/codex_agent/app.pyline 318: RISK — Preserve supplementary Unicode when serializing the new stdio fieldsCould you make
_toml_value()and_toml_key()use TOML-compatible Unicode escaping? The newcommand,argsandenvpath accepts arbitrary strings, but thisjson.dumps()emits surrogate-pair escapes for characters outside the Basic Multilingual Plane. TOML rejects those escapes, so an otherwise valid grant makes the generated Codex configuration unreadable, even if that grant is optional.My probe through
_granted_mcp_servers()andtoml_dumps()accepted ASCII andé, butargs=["/opt/🍍/server.py"]producedTOMLDecodeError: Escaped character is not a Unicode scalar value. An environment value containing the same character failed too. Run:PYTHONDONTWRITEBYTECODE=1 PYTHONPATH=/workspace/review/source python /workspace/review-probes/claude-codex/probe.py.The serializer defect predates this PR; the new task-provided stdio fields expose it to these inputs. Emit supplementary characters literally or with TOML
\UXXXXXXXXescapes, while preserving escaping for quotes, backslashes and control characters. Add atomllib.loads()round-trip check over generated stdio configurations containing ASCII, BMP and supplementary Unicode in arguments and environment values, plus quotes, newlines and DEL.
Review generated by codex. This was a full review. Request a full review with /review reset=true.
…grants branch The always-grant branch adds one test-only commit (6cd7a66) that drops a redundant terminus_2_sandboxed_agent test. No conflicts. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Adil Asif <[email protected]>
|
/review reset=true |
svcnvidia-nemo-ci
left a comment
There was a problem hiding this comment.
SHIP WITH CARE
I found one RISK: the new connection union's exported JSON/OpenAPI schema disagrees with runtime parsing, breaking schema validation of legacy HTTP grants.
I reviewed all 49 changed files and traced grant producers, adapter consumers, process cleanup, tests and documentation. The earlier Hermes optional-SSE collision, Claude Code documentation and Codex Unicode fixes are still present.
Checks attached to 8c84868d passed Nemo_CICD_Test, lint, all four core-test shards, all eight server-suite shards, sandbox tests and session-routing end-to-end. Build Gym container was skipped. Non-blocking diagnostics remain red: compliance flags unchanged run() methods; Claude Code conformance reports missing evidence and ownership failures; mini-SWE conformance timed out without usable scenario results. I did not establish that this PR caused those conformance failures.
Focused probes ran in the recovered 766267172432.dkr.ecr.us-east-1.amazonaws.com/gym:main-offline runtime with Python 3.13.14 and Node 22.15.0. Transport conversion, seed round-trips, adapter configuration, Unicode serialization, required-server failure handling and Pi cancellation/child cleanup passed. Schema probes reproduced the finding below. Python probes used actual source models, with extracted methods and fake boundaries where optional runtimes were unavailable. I relied on CI for repository suites and did not repeat the author's model rollouts.
Review generated by codex. This was a full review. Request a full review with /review reset=true.
| Annotated[MCPStreamableHTTPConnection, Tag("streamable_http")] | ||
| | Annotated[MCPSSEConnection, Tag("sse")] | ||
| | Annotated[MCPStdioConnection, Tag("stdio")], | ||
| Discriminator(_mcp_transport), |
There was a problem hiding this comment.
RISK: Keep the exported connection schema consistent with the legacy HTTP fallback.
Could you make the generated schema distinguish an omitted transport from an explicit SSE or stdio transport? This discriminated union emits oneOf, but both HTTP and SSE schemas make transport optional. Consequently, the previously valid connection={"url":"http://tools:8000/mcp"} matches both branches and fails JSON-schema validation, although _mcp_transport() correctly parses it as HTTP. Conversely, an untagged {"command":"python3"} passes the exported schema but fails runtime parsing.
My differential probe accepts the legacy HTTP grant against the base schema and rejects it against this head's schema. A minimal FastAPI endpoint using the actual AgentSeedSessionRequest returns HTTP 200 for that request, while its exported OpenAPI request schema rejects the same body. This affects schema-validating clients of the shared agent-session contract, not just one harness.
Please require explicit SSE/stdio tags in the exported validation schema, leaving omitted-tag compatibility only for HTTP, while preserving the intended Python constructor defaults. A schema override or equivalent representation can do that without removing the fallback.
Acceptance: compare runtime parsing with JSON/OpenAPI validation for legacy untagged HTTP, all three explicit transports, untagged stdio, unknown transports and mixed transport fields. The valid cases should agree, and invalid cases should fail on both paths. Probes: connection_schema_probe6350.py, public_schema6350.py and schema_repair_acceptance6350.py under /workspace/review-probes/.
…CP grant schema The MCP grant connection is a union picked by a callable discriminator that reads a connection without a `transport` as streamable HTTP. The exported JSON and OpenAPI schemas render that union as a `oneOf` in which every branch left `transport` optional, so they disagreed with parsing: an untagged HTTP connection matched both the HTTP and the SSE branch and failed schema validation although agents accept it, and an untagged stdio connection passed the schema although agents reject it. The SSE and stdio connection models now mark `transport` required, without a default, in their JSON schema (both validation and serialization modes). The Python constructors keep their defaults, so `MCPSSEConnection(url=...)` and `MCPStdioConnection(command=...)` still work, and parsing is unchanged, including the fallback to streamable HTTP for an untagged connection. Differential tests check a table of connections (untagged HTTP, each explicit transport, untagged stdio, Harbor's `streamable-http` and `http` spellings, an unknown or null transport, and mixed fields) against both parsing and a standard JSON Schema validator: against the grant model's schema, and against the agent seed route's OpenAPI request schema with a real POST. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Adil Asif <[email protected]>
|
Thanks, confirmed and fixed in dca2be4. Cause.
Every other connection the tests below check already got the same answer on both paths. Fix ( Tests. One table of 13 connection bodies is checked on both paths. Valid: untagged HTTP, explicit
On 8c84868 the two differential tests fail in exactly the four places shown above: Not covered: the schema does not express the rule that a URL must be an absolute http(s) URL. Validation (no
Rollout: N/A. Parsing and the grants agents receive are unchanged; only the exported JSON and OpenAPI schemas change. |
|
/ok to test dca2be4 |
|
/review reset=true |
svcnvidia-nemo-ci
left a comment
There was a problem hiding this comment.
SHIP WITH CARE
I found one RISK: Pi's new stdio transport can keep a finished activation alive until its overall timeout when a server stops reading stdin.
I reviewed all 50 changed files, including grant producers, adapter consumers, lifecycle handling, tests and documentation. The previous JSON/OpenAPI schema finding is fixed: differential probes confirmed that legacy untagged HTTP now validates and untagged stdio is rejected. The earlier Hermes collision, Claude Code documentation and Codex Unicode fixes are still present.
Checks on dca2be4f passed Nemo_CICD_Test, lint, all four core-test shards, all eight server-suite shards, sandbox tests and session-routing end-to-end. Build Gym container was skipped. Non-blocking compliance and conformance checks remain red; mini-SWE conformance timed out without usable scenario results. I did not establish that this PR introduced those diagnostic failures.
Focused probes ran in gym:main-offline with Python 3.13.14 and recovered Node 22.15.0. Schema/seed round-trips, Harbor conversion, adapter transport filtering, Unicode serialization, concurrent calls, cancellation and late-response isolation passed. The Pi backpressure probe reproduced the finding below; shutdown cleanup in a scratch copy removed the hang. Probes used actual source models and methods with fake external boundaries where needed. I relied on CI for repository suites and did not repeat the author's model rollouts.
Review generated by codex. This was a full review. Request a full review with /review reset=true.
| }); | ||
| // The server must not outlive Pi, which ends without waiting for it. | ||
| const stop = () => child.kill(); | ||
| process.once("exit", stop); |
There was a problem hiding this comment.
RISK: Close stdio connections when Pi shuts down its session.
Could you close kept connections on Pi's session_shutdown, rather than relying only on this process-exit handler? If a server completes discovery and then stops reading stdin, a large tool argument leaves child.stdin.write() pending. The MCP timeout rejects the call, but the outstanding pipe write keeps Node alive, so the exit handler never runs. I checked the pinned Pi 0.80.2 source: print mode disposes its runtime, emits session_shutdown, then returns without forcing process exit. An otherwise finished activation consequently waits for its overall timeout.
The probe sent a 1 MiB argument to a stalled reader. After the 500 ms MCP timeout it printed CALL TimeoutError, RUNTIME DISPOSED and PRINT EXIT 0, but Node was still alive after four seconds. A small-argument control exited normally. Registering shutdown cleanup in a scratch copy restored exit 0. The shared supervisor bounds the affected activation; this is not an unbounded cross-session leak.
Please retain and close these connections during session shutdown with bounded, idempotent child/pipe cleanup, keeping the exit handler as a fallback. Preserve active-session cancellation isolation so one timed-out call does not unnecessarily kill a usable shared server.
Acceptance: exercise a server that stops consuming stdin after discovery, send a backpressured request, let its MCP timeout expire, then finish print mode. Assert prompt client exit and child termination; retain concurrent-call and late-response isolation. Probe: /workspace/review-probes/pi-current/print_mode_backpressure.mjs.
Pi 0.80.2's print mode emits session_shutdown when a run ends, then returns without exiting the process. gym_mcp.mjs stopped a stdio server only from a process exit handler, so a server that stopped reading its standard input after discovery kept Pi alive: a large tool argument left a pipe write pending after the MCP timeout, and that write held Node's event loop until the activation's own timeout. The extension now stops the stdio servers it kept when the session shuts down: their waiting calls fail, destroying the child's standard input drops the writes it has not read, and the server is sent SIGTERM, then SIGKILL if it has not exited 2 seconds later. Stopping can be repeated, and the exit handler stays as the fallback for an exit before shutdown. A call that times out still ends only that call and leaves the shared server running for later calls. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Adil Asif <[email protected]>
|
Thanks, confirmed and fixed in 50cd0bc. Cause. In the pinned Pi 0.80.2, print mode's Fix (
Tests (
The final test file run against the extension at dca2be4 gives 22 passed and 3 failed in 26.7 s. Both shutdown cases fail with "the client did not exit by itself", killed at the 10 s bound. The stop test fails because Pinned Pi end to end. I ran the real Pi 0.80.2 CLI (
Other checks. I ran the Pi agent suite ( |
|
/ok to test 50cd0bc |
|
/review reset=true |
svcnvidia-nemo-ci
left a comment
There was a problem hiding this comment.
SHIP
LGTM — no concerns found. I reviewed all 50 changed files, including grant producers, adapter consumers, lifecycle handling, tests and documentation.
The prior Pi backpressure finding is fixed. A differential probe reproduced the hang on dca2be4f. On 50cd0bc4, repeated session shutdown exited successfully and terminated both normal and SIGTERM-ignoring stdio servers. Cancellation and late-response isolation still passed. The earlier schema compatibility, Hermes collision and Codex Unicode fixes are intact.
Checks attached to 50cd0bc4 passed lint, all eight server-suite shards, sandbox tests, session-routing end-to-end and core-test shards 0, 1 and 3. Core-test shard 2 was still running at the final read, so I have not observed a passing aggregate verdict. Non-blocking compliance and conformance checks are red. Compliance flags existing run() declarations; conformance reports ownership and evidence failures. I did not establish that this PR introduced those diagnostic failures.
Focused probes ran in gym:main-offline with Python 3.13.14, Pydantic 2.13.4 and Node 22.15.0. They passed schema/seed compatibility, Harbor conversion, transport filtering, configuration preservation, Unicode serialization and Pi shutdown/cancellation cases. Probes used actual source models and methods, with extracted methods and fake external boundaries where optional runtimes were unavailable. I relied on CI for repository suites and did not independently repeat the author's model rollouts.
Review generated by codex. This was a full review. Request a full review with /review reset=true.
… test test_shutdown_kills_descendant_after_its_wrapper_exited failed intermittently on main and in CI: - It read the child's pid as soon as the pid file existed, but the child creates the file before it writes its pid, so the read could be empty (ValueError). - It checked psutil.pid_exists and then asked psutil.Process for the status, so a child that exited in between raised NoSuchProcess. The test now waits for the pid itself, and treats a process that is gone when it is looked up as stopped, like a zombie. 30 of 30 runs pass locally, where it failed 2 of 6 on main before. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Adil Asif <[email protected]>
|
|
|
/ok to test 4ee75f0 |
|
/review reset=true |
svcnvidia-nemo-ci
left a comment
There was a problem hiding this comment.
SHIP
LGTM — no concerns found. I reviewed all 51 changed files against the admitted base, including grant producers, adapter consumers, process cleanup, tests and documentation.
The earlier schema compatibility, Hermes optional-grant collision, Codex Unicode and Pi shutdown findings stay resolved. The only change since the previous review fixes two races in the supervisor shutdown test without weakening its process-termination assertion.
On 4ee75f0f, Lint check, Unit tests / Test, all four core shards, all eight server shards, the Server suite aggregate, sandbox tests and session-routing end-to-end passed. Non-blocking compliance and conformance checks are red. Compliance flags agent run() declarations; mini-SWE conformance reports provider timeouts and missing or invalid evidence. I did not establish that this PR introduced those diagnostic failures.
Focused probes passed in 766267172432.dkr.ecr.us-east-1.amazonaws.com/gym:main-offline, with Python 3.13.14, Pydantic 2.13.4 and Node 22.15.0. They exercised Harbor grant conversion, runtime/JSON/OpenAPI compatibility, adapter filtering and configuration preservation, Unicode serialization, required-server failure handling, and Pi backpressure shutdown and cancellation isolation. Probes used actual source models and methods with fake external boundaries where needed. I relied on CI for repository suites and did not independently repeat the author's real-model rollouts.
Review generated by codex. This was a full review. Request a full review with /review reset=true.
…nto adasif/harbor-stdio-sse-mcp-grants Conflicts with main, each resolved keeping both sides: - nemo_gym/server_runtime/__init__.py: this branch's MCPTransport export next to main's OwnedSandboxes and sandbox_borrow exports. - codex_agent/app.py: this branch's CODEX_MCP_TRANSPORTS, grant secret and TOML string helpers next to main's exact-version and [agents] version constants and _version_numbers. - openhands_agent/app.py: this branch's OPENHANDS_MCP_TRANSPORTS next to main's comment, which no longer names an SDK version. - openclaw_agent/README.md: this branch's per-transport grant text with main's tool-search and probe exit text for OpenClaw 2026.11.5. - opencode_agent/README.md: this branch's per-transport grant text with main's tool-name collision text. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Adil Asif <[email protected]>
…e configures main's check for two MCP grants whose tools OpenCode could register under one name selected the grants with isinstance(access, MCPToolAccess). This branch no longer imports MCPToolAccess in the OpenCode adapter, so after the merge of main every sandbox seed failed with a NameError (41 failed tests in opencode_agent). The check now runs over mcp_grants_over(..., self._mcp_transports), the grants OpenCode configures: every MCP grant for OpenCode 1, streamable HTTP grants for OpenCode 2, which leaves an optional SSE or stdio grant out and registers no tools for it. A test for each case: OpenCode 1 still refuses an SSE or stdio grant whose tools could share a name with another grant's, and OpenCode 2 keeps a session whose only such grant is one it leaves out. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Adil Asif <[email protected]>
|
Updated with
Conflicts in
Fix Tests (
|
|
/ok to test 8ed1677 |
|
/review reset=true |
…a loaded runner The test gave the whole stdio server a 300 ms call timeout so the held call times out quickly, but the calls answered at once ran under the same limit and timed out on a loaded CI runner. The server timeout is now 2 s: only the held call waits it out. 12 of 12 local runs pass with six test processes at a time. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Adil Asif <[email protected]>
|
|
|
/ok to test 0312e8d |
|
/review reset=true |
svcnvidia-nemo-ci
left a comment
There was a problem hiding this comment.
SHIP
LGTM, no concerns found. I reviewed all 51 changed files, with separate reviews of Harbor/shared contracts, Python adapters and Pi lifecycle behavior. I traced grant production, configuration consumers, process cleanup, tests and documentation.
I compared against the reachable previous-review commit 4ee75f0f. The earlier schema compatibility, Hermes optional-grant collision, Codex Unicode and Pi backpressure/shutdown findings stay resolved. The latest timeout adjustment keeps the test's concurrent-call and late-response assertions intact.
The checks attached to 0312e8dc passed lint, all four core shards, combined coverage, all eight server shards, sandbox tests, LongMT scoring and session-routing end-to-end. Both Unit tests / Test and Unit tests / Server suite are green. Changed server tests was skipped, not passed. Non-blocking compliance reports existing run() declarations; OpenClaw and mini-SWE conformance timed out after five minutes without usable scenario results. I did not establish that this PR introduced those conformance failures.
Purpose-built CPU probes passed in 766267172432.dkr.ecr.us-east-1.amazonaws.com/gym:82ded40c139ecf82e8053592f13b40e70f98eef4, the verified default-branch CI image because no head image was available, using Python 3.13.14, Pydantic 2.14.4 and Node 24.19.0. They exercised runtime/JSON/OpenAPI agreement across 80 connection cases, Harbor conversion, adapter filtering and configuration preservation, Unicode TOML round-trips, and Pi cancellation isolation, child failure and backpressured shutdown. The actual-source probes used fake external boundaries.
An auxiliary fake-agent lifespan probe timed out after 180 seconds and is inconclusive; the separate real-route/OpenAPI probe passed. Initial image-import mismatches were corrected before the successful probes. I relied on CI for repository suites and did not repeat the author's real-model rollouts.
Review generated by codex. This was a full review. Request a full review with /review reset=true.
What does this PR do?
A Harbor task can declare
stdio,sse(Harbor's default) orstreamable-httpMCP servers. TheharborEnvironment Server granted only
streamable-httpones, so CLI harnesses were refused tasks with stdio or SSE servers.As a maintainer decided, the CLI starts a stdio server itself, as Harbor does, with no bridge in the Environment
Server.
MCPToolAccess.connectionbecomes a union keyed ontransport: the unchangedMCPStreamableHTTPConnection, a newMCPSSEConnection(url, headers) andMCPStdioConnection(command, args, env).A connection with no
transportstill parses as streamable HTTP. Helpersmcp_grants_over,unusable_required_grantsandmcp_server_urlslet adapters keep, refuse and allow-list grants by transport.MCP client runs
commandandargsin the task sandbox as the agent user. Harbor 0.22's entry has no env or headerfield, so grants carry no task secret. An entry the grant schema rejects is still only warned about.
stdio/ssein--mcp-config), OpenCode 1 (local/remote) and mini-SWE take allthree transports. Codex, Hermes and Pi take stdio but not SSE, so they refuse a required SSE grant with a 422 that
names it: Codex and Pi have no SSE client, and Gym does not configure SSE grants for Hermes yet (the Hermes pin on
main, v0.23.2, has an SSE transport). Pi'sgym_mcp.mjsgains a stdio transport; the child holds Pi's event loop only while a requestis pending and is killed when Pi exits. OpenCode 2, Kilo, OpenClaw, CrewAI and OpenHands refuse a required stdio or
SSE grant and skip an optional one, instead of failing on a missing URL.
and integration pages and the READMEs follow.
No issue was filed; this follows the maintainer's decision for SkillEvaluator task folders.
Validation
On the head
242946fc4(mainat15adc2254merged in through the always-grant PR (#6292) and the Claude Code MCPgrants PR (#6349)), with
gym env test(pytest runs serially, one suite at a time):environment_servers/harbor: 741 passedclaude_code_agent: 332 passedcodex_agent: 633 passed, 9 skippedopencode_agent: 1154 passed, 25 skippedhermes_agent: 407 passed, in a venv built fresh for the merged treepi_agent: 416 passed, 32 skippedmini_swe_agent: 187 passedminiswe_sandboxed_agent: 213 passed. A first run under load failed 2 native-runner timing tests intest_worker.py; run alternately three times each with one venv,test_worker.pyfailed 2 of 7 once on this head and 1 of 7 once onmain15adc22542(the same[timeout]case), and passed the other runs. This PR changes only a comment, a README line and a test docstring in that agentkilocode_agent: 258 passed, 26 skippedopenclaw_agent: 570 passed, 2 skippedcrewai_agent: 95 passedopenhands_agent: 150 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 onmain15adc22542tests/unit_tests/server_runtime(-n 2): 2159 passed, 1 collection error:test_review_boundary_interfaces.pyneedscloudpickle, which the dev venv lacks; same onmain15adc22542in a dev venv built from the same lockBefore that update,
pytest -n 8passed each touched suite, with the same counts onc799e6a25and5f2531e04(a Pitest fix): Harbor server 741, Claude Code 241, Codex 592 (6 skipped), OpenCode 1017 (9 skipped), Hermes 404, Pi 393
(22 skipped), mini-SWE 187 (needs
uvonPATH), Kilo 277 (7 skipped), OpenClaw 561 (1 skipped), CrewAI 95,OpenHands 150.
node --testsuites pass;test_gym_mcp.mjspasses 21 tests and leaves no temp directory behind.alone (5 of 5) and in a full rerun.
types.
tests/unit_testsonc799e6a25: 23,654 passed and 295 skipped; of the 132 failures and errors, 131 occur the sameway without this change (missing optional extras, environment-bound tests) and one timing test passes alone
(3 of 3). A focused core rerun on the final head passed 4,809; its 5 failures and 1 error also occur without this
change.
pre-commit runon the changed files passes every hook.Rollouts
Runs used a hosted GPT model behind an OpenAI-compatible endpoint, on OpenSandbox, with the tree of
c799e6a25;they were not rerun on the head after the
mainupdate. Thestdio task's image holds a stdlib-only MCP server whose
get_magic_wordtool returnspineappleand logs every call;test.shscores 1 only when the answer ispineappleand the log shows the call. The SSE variant serves the same toolfrom an HTTP+SSE Compose sidecar. Neither task is in the repo.
mini_swe_agent_sandboxed)... (Codex has no SSE MCP client); required grants it cannot use: magic (sse)kilocode_sandboxed)Kilo supports only streamable HTTP MCP tool grants; unsupported required grants: magic (stdio)gym dataset validate)In the Claude Code and Codex runs, the server log shows the harness started it in the sandbox as the agent user
(root here) with the image's
/usr/local/bin/python3; Hermes also ran the image'spython3.After the
mainupdate, a combined branch of this PR with the other SkillEvaluator-related PRs, on the samemain(
51630ce4f) and with the same resolutions, ran SkillEvaluator tasks whose stdio MCP server'sget_magic_wordtoollogs each call. On Claude Code, Codex, OpenCode, Hermes and Pi, every one of the 20 MCP rows called the tool and its
grader found the call in the server's log. SSE and streamable HTTP were not exercised there.
Compatibility and benchmark impact
compose_overlaySSE entry, now run on harnesses that speak thosetransports. Other harnesses refuse them at seed and name the grant; before, the server's task-context check refused
them. mini-SWE now reads these servers from the grant rather than from task.json.
headersfield newer Harbor MCP entries have.Not tested
[agent].user.envholding secrets: Harbor's entry has noenv.Checklist
pre-commit run --all-files) (so CI lint/format checks pass). Run on the changed files only.git commit -s) (so the DCO check passes).🤖 Generated with Claude Code