Skip to content

fix(agent): unify context compaction trace contract - #2870

Open
aroshanghias-nvd wants to merge 1 commit into
NVIDIA-NeMo:mainfrom
aroshanghias-nvd:aroshanghias/rollout-trace-contract-cleanup
Open

fix(agent): unify context compaction trace contract#2870
aroshanghias-nvd wants to merge 1 commit into
NVIDIA-NeMo:mainfrom
aroshanghias-nvd:aroshanghias/rollout-trace-contract-cleanup

Conversation

@aroshanghias-nvd

@aroshanghias-nvd aroshanghias-nvd commented Aug 29, 2026

Copy link
Copy Markdown
Contributor

Summary

  • replace the two lifecycle-specific context-compaction contracts with one unversioned rollout_trace_contract
  • return the same bounded, digest-backed model_call_metadata representation whether resource verification runs or is skipped
  • keep full completion evidence available to the resource verifier while removing validation-only duplication from /run responses
  • leave simple_agent and ordinary non-compaction responses unchanged

Motivation

The previous schema_version: 2 and schema_version: 3 values distinguished internal processing stages rather than revisions of a public protocol. They also made the /run trace representation depend on skip_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_contract becomes rollout_trace_contract
  • schema_version, mode, and format discriminators are removed
  • /run always exposes digest-bound model_call_metadata; full completion_evidence remains verifier-internal

No 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
  • live deterministic rollout through separate model, resource, and agent HTTP server processes
    • verified and skipped-verification /run responses had the same bounded trace representation
    • only the verified path called /verify, where full token/log-probability evidence remained available
    • exported generation_evidence_digest matched the canonical prompt, sampled-token, and sampled-log-probability arrays

Signed-off-by: Ali Roshan Ghias <aroshanghias@nvidia.com>
@copy-pr-bot

copy-pr-bot Bot commented Aug 29, 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant