fix(agent): unify context compaction trace contract - #2870
Open
aroshanghias-nvd wants to merge 1 commit into
Open
fix(agent): unify context compaction trace contract#2870aroshanghias-nvd wants to merge 1 commit into
aroshanghias-nvd wants to merge 1 commit into
Conversation
Signed-off-by: Ali Roshan Ghias <aroshanghias@nvidia.com>
aroshanghias-nvd
marked this pull request as ready for review
August 29, 2026 07:02
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.
Summary
rollout_trace_contractmodel_call_metadatarepresentation whether resource verification runs or is skipped/runresponsessimple_agentand ordinary non-compaction responses unchangedMotivation
The previous
schema_version: 2andschema_version: 3values distinguished internal processing stages rather than revisions of a public protocol. They also made the/runtrace representation depend onskip_verification, forcing consumers to support two encodings of the same rollout.Verification controls reward provenance, not trace encoding. This change therefore keeps separate internal validation and external transport models in Gym while exposing one canonical wire representation.
This intentionally replaces the recently introduced opt-in fields rather than retaining aliases:
context_compaction_contractbecomesrollout_trace_contractschema_version,mode, andformatdiscriminators are removed/runalways exposes digest-boundmodel_call_metadata; fullcompletion_evidenceremains verifier-internalNo upstream NeMo-RL consumer currently depends on the previous shape.
Validation
pytest -q responses_api_agents/simple_agent_with_compaction/tests/test_app.py responses_api_agents/simple_agent_with_compaction/tests/test_compaction.py(49 passed)pre-commit run --all-files/runresponses had the same bounded trace representation/verify, where full token/log-probability evidence remained availablegeneration_evidence_digestmatched the canonical prompt, sampled-token, and sampled-log-probability arrays