Skip to content

cp: fix(hermes): report native token usage (4139) into r0.7.0 - #4185

Merged
ananthsub merged 1 commit into
r0.7.0from
cherry-pick-4139-r0.7.0
Oct 7, 2026
Merged

ananthsub merged 1 commit into
r0.7.0from
cherry-pick-4139-r0.7.0

Conversation

@svcnvidia-nemo-ci

Copy link
Copy Markdown
Contributor

beep boop [πŸ€–]: Hi @giuliolovisotto πŸ‘‹,

we've cherry picked #4139 into `r0.7.0` for you! πŸš€

Please review and approve this cherry pick by your convenience!

Hermes returned zero input and output tokens for every rollout, even
when the pinned native harness supplied nonzero usage. Export its
cache-inclusive `prompt_tokens` and `completion_tokens` through the
shared host/sandbox response converter, with cache and reasoning
details. Missing native totals now remain unknown instead of becoming
zero. This preserves the provider-failure and partial-result behavior
established in #3720 and #3554.

No linked issue: this fixes a token-accounting failure found during
conformance validation.

Validation:
- Seven regression cases failed against the original converter and pass
with this change; they cover cache-inclusive totals, partial results and
missing usage/details.
- `gym env test +entrypoint=responses_api_agents/hermes_agent
+should_validate_data=true +skip_venv_if_present=true`: 222 passed, 4
skipped.
- `pre-commit run --all-files`: passed.
- Final-head CI passed, including core tests, all eight server-test
shards, lint and DCO.
- Real ReasoningGym `manipulate_matrix`, seed 42, one task/repeat with
the same model and native verifier: reward 1.0, health **healthy**,
1,235 input / 376 output tokens. Original run was unhealthy because its
response reported zero tokens. Capture and observability were enabled;
the live agent source hash matches this commit.
- Seven fresh controlled scenarios through the native adapter: five
healthy, one correctly unhealthy for intentionally omitted provider
usage, one unobserved terminal-error sidecar. Before the fix: zero
healthy, six unhealthy, one unobserved. P0 conformance remains
incomplete for missing retry/terminal-error evidence.

- Real native SWE-Pro NodeBB sandbox rollout: 91 model calls,
**healthy**, no findings or unobserved rollout checks. Independent
capture reconciliation matched all 1,874,133 input / 4,611 output /
1,830,400 cached input tokens. The native verifier completed with reward
0: the model supplied a plan and only created a backup file; the
required `getOrCreate()` implementation remained missing. This validates
accounting, not task correctness.
- Sandbox run used the pinned native Hermes revision
`26bb847a88493342ca1b194e0455b479073ae21d` and task image
`sha256:605b6da16030d20129e0b9f9376fd494d60ec5f68f5e05f608742133bd39ae98`.
A Linux-prepared runtime was mounted to meet the documented host/sandbox
architecture requirement, and the existing
`chat_template_kwargs_enabled=false` option was used for hosted GPT-4.1.
Agent/resource/verifier code and task contents were unmodified. The
all-P0 artifact assessment still lacks sandbox lifecycle evidence;
healthy does not imply full conformance.

This exposes the aggregates produced by pinned Hermes. It does not
repair native omissions from auxiliary or delegated calls, nor infer
missing usage from the health check's capture data. Both live runs
exercised ordinary root calls; the SWE-Pro run completed before its
100-turn limit, so limit-summary and delegated-call accounting remain
unvalidated.

Review coordination: a maintainer requested consolidation with #3981,
which derives usage from shared lifecycle capture and leaves direct
`/v1/responses` usage null. This narrower implementation exports native
Hermes aggregates without requiring capture. The approaches overlap and
should be consolidated deliberately; the live results above validate
this PR's implementation, not #3981.

Signed-off-by: Giulio Lovisotto <glovisotto@nvidia.com>
Signed-off-by: NeMo Bot <nemo-bot@nvidia.com>
@svcnvidia-nemo-ci svcnvidia-nemo-ci added area:agent Agent harnesses and Responses API agent behavior bug Something isn't working cherry-pick complexity:low Localized change in one scope with a small, straightforward review surface needs-review PR is ready for code review and waiting on a reviewer Run CICD labels Oct 7, 2026
@copy-pr-bot

copy-pr-bot Bot commented Oct 7, 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

Copy link
Copy Markdown
Contributor Author

/ok to test cd478d7

@ananthsub
ananthsub merged commit 0220fe9 into r0.7.0 Oct 7, 2026
44 checks passed
@ananthsub
ananthsub deleted the cherry-pick-4139-r0.7.0 branch October 7, 2026 19:04

This branch was previously deployed

1 inactive deployment
public β€” cd478d77 Deployed Oct 7, 2026 by copy-pr-bot[bot] via release / finalize / notify #4575
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 cherry-pick complexity:low Localized change in one scope with a small, straightforward review surface needs-review PR is ready for code review and waiting on a reviewer Run CICD

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants