Repository navigation
feat(hermes): set the context window compression reads (context_length) - #5777
Conversation
Hermes compresses at compression_threshold of its context window. The generated config.yaml names the model only, so Hermes probes the endpoint, which the Gym model server does not answer, and assumes 128,000 tokens: on a 262,144-token server it compresses at 108,800 tokens instead of 222,822. context_length writes model.context_length, Hermes' own override; unset keeps today's config. Checked against the pinned hermes-agent 26bb847a: AIAgent reads 262144 and a 222,822-token threshold with it, 128000 and 108,800 without. Signed-off-by: gwarmstrong <[email protected]>
|
/ok to test 00babfc |
svcnvidia-nemo-ci
left a comment
There was a problem hiding this comment.
SHIP
LGTM — no concerns found.
I reviewed all three changed files and traced the configuration through host and sandbox execution. The override is opt-in, the unset branch preserves the existing model-name string, and the sandbox runner retains the model mapping. The added tests assert concrete values for both configured and unset cases.
This was a static review. I didn't execute tests or reproduce the reported rollouts. Hermes' external implementation isn't mounted, so I verified the adapter's propagation rather than Hermes' internal interpretation.
Note: formal approval is not available for this request, so this review is posted as a comment only.
Review generated by codex. This was a full review. Request a full review with /review reset=true.
|
🔄 Merge queue validation started! You can track the progress here: https://github.com/NVIDIA-NeMo/Gym/actions/runs/42316455715 |
Resolve the integrate-existing-agents conflict by keeping main's task-folders link and dropping hermes_sandboxed_agent from the deprecated list. Replace the harbor-tasks example of an ambiguous --agent with terminus_2, since `hermes` now resolves to hermes_agent alone. Update the Hermes migration notes for main's context_length setting (NVIDIA-NeMo#5777): it keeps its name but sets only model.context_length, where the removed adapter also set the summarization auxiliary's window. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: yaoyu-33 <[email protected]>
What does this PR do?
hermes_agentgainscontext_length(unset by default). It writes Hermes' ownmodel.context_lengthoverride into the generatedconfig.yaml, so context compression reads the model's real window.Why: Hermes compresses at
compression_thresholdof its context window. The generated config names the model only, so Hermes probes the endpoint for the window. The Gym model server does not answer that probe (it serves no/v1/models), and Hermes falls back to 128,000 tokens. On a 262,144-token server it then compresses at 108,800 tokens instead of 222,822. No issue was filed; the fix is one config field.Defaults are unchanged: without
context_length, the config is written exactly as before.Validation
gym env test +entrypoint=responses_api_agents/hermes_agent: 370 passed.Two new tests:
context_lengthis written asmodel: {default: <name>, context_length: <n>};modelstays the plain name.The first fails on the previous
app.pyand passes with this change.Against the pinned hermes-agent (
26bb847a),AIAgentbuilt from each config reports:context_length: 262144:context_compressor.context_length262144, threshold 222,822 tokens;pre-commit runon the changed files: clean. DCO sign-off.Rollouts
Real-model evidence comes from full HLE Diamond text rounds: 728 questions, Super 3.5, Hermes through a
hermes_agentsession, run through NVIDIA's eval-factory recipes. The round with Hermes' 128,000 fallback and the round withcontext_length: 262144scored 0.091 and 0.082. All 728 questions were graded in both. The gap is within the round-to-round spread we measured on this set (0.01–0.02). The setting changes when Hermes compresses, not whether a run completes.Compatibility
Opt-in only. Existing configs and results are unchanged.