Repository navigation
fix(critpt): include both turns in token usage - #3580
Merged
Merged
Conversation
Signed-off-by: Igor Gitman <[email protected]>
bxyu-nvidia
approved these changes
Sep 21, 2026
Contributor
|
/ok to test 4fd1e74 |
This branch was previously deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
CritPt currently reports only the formatting turn's token usage, dropping the solve turn. Sum both turns into the existing response
usageso the standard input, output, and total token metrics cover the complete task. This follows Artificial Analysis's methodology, which includes both solving and answer parsing.The change reuses the shared usage accumulator and adds no metrics or configuration. If either turn omits usage, report
nullrather than a partial total. The second-turn output still goes to the same verifier; prompts and scoring are unchanged. Existing saved rollouts retain their old counts, so historical second-turn-only token metrics are not directly comparable.No separate issue is needed for this focused accounting bug. The original integration and discussion in #1588 were reviewed. The agent README documents the corrected usage semantics.
Validation (server-only change):
gym env test +entrypoint=responses_api_agents/critpt_agent +should_validate_data=true— 27 passed.python -m pytest tests/unit_tests/test_openai_utils.py -o addopts= -q— 242 passed.python -m pytest resources_servers/critpt/tests -o addopts= -q— 57 passed outside the sandbox (the sandboxed TestClient hung).pre-commit run --all-filesandgit diff --check— passed.