Skip to content

fix(claude-code): keep reasoning out of evaluation answers - #5829

Open
linj-glitch wants to merge 1 commit into
NVIDIA-NeMo:mainfrom
linj-glitch:linj/claude-code-eval-reasoning
Open

linj-glitch wants to merge 1 commit into
NVIDIA-NeMo:mainfrom
linj-glitch:linj/claude-code-eval-reasoning

Conversation

@linj-glitch

Copy link
Copy Markdown
Collaborator

What does this PR do?

Fixes #5565.

Claude Code evaluation currently prepends thinking to assistant text, including thinking carried across tool-only turns. This sends reasoning to graders as part of the answer. Emit separate Responses reasoning items in evaluation and capture modes, leaving assistant text unchanged. Rename the parser switch to capture_transcript so it describes the remaining capture-specific behavior: subagent filtering and retaining pending calls in model order.

Validation

  • responses_api_agents/claude_code_agent/.venv/bin/python -m pytest responses_api_agents/claude_code_agent/tests -q: 201 passed using the component's frozen dependencies, Python 3.13.14.
  • Five evaluation regression tests fail against the previous parser and pass with this change. Coverage includes thinking-only events, later answers, and tool-only turns; additional tests preserve literal markup, subagent filtering, usage, and terminal response attribution.
  • pre-commit run --all-files: passed. Rechecked pre-commit run guardwords-check with the final changes staged.
  • git diff --check: passed.

Rollouts

Ran Claude Code 2.1.280 through Gym's local VLLMModel /v1/messages, using vLLM 0.22.0 and Qwen/Qwen3-1.7B at revision 70d244cc86ccca08cf5af4e1e306ecf908b1ad5e. For a task asking for 17 + 25, the actual CLI generated 299 characters of reasoning and answered 42. The agent returned separate reasoning and message items; Gym's equivalence_llm_judge received exactly 42 and returned reward 1.0 ([[A=B]]).

Replaying the same CLI transcript through the previous parser reproduced the <think>...</think> prefix in the grader's candidate answer. Capture-mode output (normalizing generated item IDs) and metadata matched between the previous and updated parsers. This was a representative local evaluation and verifier smoke, plus capture replay parity.

Compatibility and benchmark impact

Evaluation scores may change because reasoning is no longer injected into answers. Consumers needing reasoning should read the separate reasoning items. Direct parser callers using fold_thinking=False should migrate to capture_transcript=True; evaluation uses the default False. The agent README documents this migration. Capture-specific filtering, pending-call handling, usage, and terminal attribution are preserved.

Checklist

  • I have read the contributing guidelines.
  • The change is focused; unrelated edits are excluded.
  • Tests added or updated and pass locally.
  • Documentation updated.
  • Pre-commit checks pass locally.
  • New source files include the required Apache-2.0 SPDX header (N/A: no new source files).
  • All commits have DCO sign-off.

@linj-glitch linj-glitch added bug Something isn't working area:agent Agent harnesses and Responses API agent behavior needs-review PR is ready for code review and waiting on a reviewer labels Nov 8, 2026
@copy-pr-bot

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

@github-actions github-actions Bot added the sla:review-overdue Review response is over the one-business-day SLA label Nov 10, 2026
@lafrancef

Copy link
Copy Markdown
Contributor

Please rebase to harmonize with #5955 and run tests, then I can take a look.

Regarding this point: "Evaluation scores may change because reasoning is no longer injected into answers"
We should not change default behavior that can affect evals without running those evals first.

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:agent Agent harnesses and Responses API agent behavior bug Something isn't working needs-review PR is ready for code review and waiting on a reviewer sla:review-overdue Review response is over the one-business-day SLA

Projects

None yet

Development

Successfully merging this pull request may close these issues.

claude_code_agent: eval output folds the model's thinking into the graded answer

2 participants