Repository navigation
Conversation
gpt-oss calls its built-in container.exec tool even when the request declares no tools, and NVIDIA-hosted endpoints return that call as an mcp_call item without running it. Terminus 2 keeps the model's output items in its transcript, so the Harbor environment server's ATIF export met an item it rejected and masked the episode as harbor:trajectory_export_failed. The item is the model's own output, so the exporter now represents it: an agent step with one tool call, the endpoint's output or error as the step's observation, and a call with neither listed in open_tool_calls. Signed-off-by: Ananth Subramaniam <[email protected]>
An mcp_call's ID now counts against function call IDs in both orders, and two answered mcp_calls with one ID are rejected. An error that comes with output is kept in the result's extra instead of being dropped, and a status other than completed is kept in the call's extra. The NeMoGymResponseMcpCall docstring now says what the hosted gpt-oss endpoint returns: the container.exec call with no output or error, because the endpoint did not run it. Signed-off-by: Ananth Subramaniam <[email protected]>
An mcp_call was checked only against function calls still open, so one reusing the ID of an answered function call exported a second tool call with that ID. The check now covers every function call ID exported. The transcript export's duplicate error names a tool call, the ATIF term, since either kind of item can raise it. Signed-off-by: Ananth Subramaniam <[email protected]>
svcnvidia-nemo-ci
left a comment
There was a problem hiding this comment.
SHIP
LGTM — no concerns found.
I reviewed all three changed files and traced the transcript exporter through Terminus transcript production and Harbor verification. The new mapping preserves endpoint results, errors, status, and unanswered calls; mixed MCP/function ID collisions are checked in both orders. The regression tests assert concrete outcomes, and strict rollout export remains unchanged.
This was static review. I didn't execute tests or independently reproduce the reported smoke 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 full review. Request a full review with /review reset=true.
The NeMoGymResponseMcpCall and transcript export docstrings now say what an mcp_call is and how it is handled, without naming a model or a hosting provider. Signed-off-by: Ananth Subramaniam <[email protected]>
marcromeyn
left a comment
There was a problem hiding this comment.
The MCP shape from the smoke exports correctly, and the strict exporter still rejects mcp_call. Two paths still mask a gradable episode, as far as I can tell:
NeMoGymResponseMcpCall.idis optional, and Terminus passes such items through, but the live exporter raises "MCP calls need an id and a name" when it's missing or blank. Harbor then skips grading. Could it generate a deterministic ID that can't collide with a real one, and mark the conversion partial?- Arguments like
{"query":"\ud800"}parse as an object, so the call counts as converted, but encoding the trajectory then fails on the unpaired surrogate. Routing values that can't be encoded through the existingraw_arguments/unparsable_argumentsfallback would cover it.
Smaller: a test with plain-text MCP arguments, like the Harmony case from the smoke, would pin that raw_arguments survives the metadata merge; the new fixtures all use valid JSON. And the docstrings read null output and error as "the tool never ran". status="in_progress" with both null is accepted too, so "no result returned" is the safer wording.
What changed
The Harbor environment server exports each agent transcript to ATIF before it verifies an episode. That export rejected
mcp_callitems, and the rejection masked the episode asharbor:trajectory_export_failed. The exporter (transcript_to_atifinnemo_gym/trajectory/atif_export.py) now represents them:mcp_callexports as an agent step with one tool call. The call keeps itsserver_labelin the call'sextra, and so does any status other thancompleted.extra.open_tool_calls.mcp_callitems and function calls, in either order. The duplicate error now says "tool call", the ATIF term, because either kind of item can raise it.The
NeMoGymResponseMcpCalldocstring now describes what the hosted endpoint actually returns.Why
Harbor runs of
terminus_2_sandboxed_agentwith gpt-oss-20b masked 9 of 12 episodes this way, with one agent worker and with four.The items come from the model endpoint. gpt-oss calls its built-in
container.exectool even when the request declares no tools. The NVIDIA-hosted endpoint returns that call as a typedmcp_callwithoutputanderrorboth null, because it did not run the call. A direct request to the endpoint, made outside Gym, returned this item:{"id": "mcp_90ce2d07847e2efe", "type": "mcp_call", "name": "exec", "server_label": "container", "arguments": "{\"cmd\":[\"bash\",\"-lc\",\"git log --oneline --decorate --graph --all\"],\"timeout\": 10000}", "approval_request_id": null, "error": null, "output": null, "status": "completed"}Gym's model server rejects untyped output items, so Gym does not create these items; it passes them through. Terminus 2 reads only message and reasoning text, so it ignores the call and keeps the item in its transcript. The item is model output, and the transcript is also training data, so the fix belongs in the exporter rather than in dropping the item.
The strict rollout exporter (
gym_rollout_to_atif) still rejectsmcp_callon purpose. That is unchanged.No issue is linked: the problem showed up while validating #5988, and its Harbor smoke showed the masking with one worker too, so it predates that PR.
Validation
tests/unit_tests/trajectory/test_atif_export.py, run in a venv with Harbor installed so that the check against Harbor's own trajectory schema runs instead of skipping. The new cases cover an unrun call followed by a Terminus turn, a call with output, error, or both, a status other than completed, duplicate IDs in every order, and a missing or blank ID or name. They fail againstmain's exporter and pass here.responses_api_agents/terminus_2_sandboxed_agent/tests/test_observability.py.pre-commit run --fileson the changed files.Rollout evidence
Same command before and after, with Docker sandboxes:
gym eval run terminal_bench_2_1 --agent terminus_2_sandboxed_agent --sandbox docker \ --model-type openai_model --model nvidia/openai/eccn-gpt-oss-20b \ --only-tasks fix-git,log-summary-date-ranges,git-multibranch --num-repeats 4 --concurrency 12harbor:trajectory_export_failed.mcp_callitems, 89 in all, every one withoutputanderrornull.execwith its parsed arguments andserver_label: container, the next Terminus turn is its observation, and the call ID is inopen_tool_calls.This shows the export works, not grading: every reward was 0, which is the 20B model failing these tasks.
Two things the smoke showed are out of scope here; both are endpoint or parser behavior:
mcp_callitems come from malformed Harmony headers, where the endpoint reads a channel tag such asassistant<|channel|>analysisas the tool name and the model's analysis text as arguments. These export with the raw text kept inraw_arguments, and the trajectory is marked partial withunparsable_arguments.Compatibility
Transcripts that used to fail now export, which changes masking results for gpt-oss runs on hosted endpoints. The transcript export's duplicate-ID error text changes from "function call" to "tool call".