Skip to content

[NVBug 6751030] Verify fixed: assistant reasoning_content accepted in Chat replay #4491

Closed

Description

@qiaochuz-nv

Queue rank 4/48 · Difficulty 1/5 · Status on main: fixed

NVBug: https://nvbugspro.nvidia.com/bug/6751030 · NVBug priority: Unprioritized · ARB: Yu Yao
GitHub: #3542 (fix) · related: #3711, #4180 · JIRA NMGYM-50

Summary

Gym's chat request validation rejected an assistant reasoning_content field with HTTP 422 (extra_forbidden). The shipped Hermes agent runs insert_reasoning=True, so after a first turn that returns a tool call plus reasoning, the second request replayed that reasoning in assistant history and Gym rejected its own agent's output. Already fixed on main by PR #3542.

Reproduction

At Gym 40625e6, run the bug's no-network diagnostic (repro_gym_hermes_reasoning_content.py): validating an assistant message carrying reasoning_content + tool_calls via NeMoGymChatCompletionCreateParamsNonStreaming exits 1 with extra_forbidden on messages[2]...reasoning_content. E2E: model_call_capture_agents hermes case, which returns captured status [200, 422].

Root cause

NeMoGymChatCompletionAssistantMessageParam (a strict TypedDict) did not accept a non-null reasoning_content. At 40625e6 the field was absent; from #3187 it was Annotated[None, Field(exclude=True)], accepting only None. The Hermes replay sends a real string, so validation failed before any upstream inference call.

Status on main (fixed)

PR #3542 (commit 99828ca, merged 2026-09-28) is in current main (HEAD 75bb53e). git show 99828caf1 -- nemo_gym/openai_utils.py: - reasoning_content: Annotated[None, Field(exclude=True)] / + reasoning_content: str | None (now at openai_utils.py:1347,1352). Hermes still replays (hermes_agent/app.py:788 insert_reasoning=True). The same commit added CPU unit test tests/unit_tests/test_hermes_reasoning_replay.py. GPU run 0f9e2c1e (hermes_reasoning_gym) exercised multi-turn replay: 14/14 POST /v1/chat/completions returned 200 — note the replayed reasoning_content is inferred there (capture off) per the run comment.

Proposed fix

None needed — fixed by #3542. Work is verify-and-close. Do not re-open for the rc1 model_call_capture_agents failure: that is a stale QA expectation (client_assistant_message_id from main-only #3711), being re-tagged to v0.8.0, not this bug.

Validation

  • CPU: run tests/unit_tests/test_hermes_reasoning_replay.py (both None and string reasoning).
  • QA: testcases/integrations/model_call_capture_agents.py hermes case — the 5/5 on run 2070f4dd is the suite total; that run's hermes capture was single-turn and did NOT exercise replay, so replay evidence is the separate GPU run 0f9e2c1e. Rerun testcases/environments/kilocode_math.py on a tree with feat: add sandboxed Hermes for SWE-bench Pro #3542 to confirm the 422 is gone.

Triage

Difficulty 1/5 — already fixed and unit-tested on main; only verify-and-close remains. Needs GPU/model: no (CPU unit test + static evidence suffice). External dependency: none.

Reviewer notes

Verifier independently confirmed fixed (99828ca/#3542 is an ancestor of HEAD; field loosened; unit test added) and difficulty 1 (verify-and-close). Corrections applied: the 5/5 on run 2070f4dd is the suite total and did not exercise replay (hermes capture was single-turn) — replay evidence is GPU run 0f9e2c1e, where replayed reasoning_content is inferred (capture off). Testcase names match the bug record.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions