Skip to content

fix(hermes): retain compaction calls and history - #5311

Merged
giuliolovisotto merged 3 commits into
mainfrom
codex/fea-518-hermes
Nov 4, 2026
Merged

giuliolovisotto merged 3 commits into
mainfrom
codex/fea-518-hermes

Conversation

@giuliolovisotto

@giuliolovisotto giuliolovisotto commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

What does this PR do?

Hermes compression uses an auxiliary client whose routing no longer follows OPENAI_BASE_URL; its helper usage and removed conversation history also disappear from Gym's exported artifacts. Configure compression's auxiliary client with the episode's actual model-server URL, including the rollout route, and observe the compressor's real model responses.

Retain helper IDs, actual summaries and usage, scope capture to each invocation, and restore executed history when exporting observations/output. Hermes still receives its compacted model context. A protected-history no-op produces no completed event; missing helper usage remains unknown rather than an apparently complete aggregate. Host validation adds the model-server scope to helper references.

Earlier validation

python -m pytest -q responses_api_agents/hermes_agent/tests --disable-warnings: 354 passed. Coverage includes model-server routing, protected-history no-ops, repeated compaction, helper usage omission, summary capture, and restored executed history.

Rollouts

The pinned Hermes runtime passes the final shared compaction scenario: 16 calls, 15 policy turns, one event, reused summary and retained helper usage. All eight existing P0 scenarios pass. Reproduce with python scripts/run_harness_conformance.py --harness hermes --scenario context_compaction --gate-tier P1 --output results/hermes-compaction in the Hermes environment.

Compatibility and benchmark impact

The agent-session path now routes compression through Gym and includes its cost and original executed history in exported artifacts. Root/delegated invocation ownership is preserved. Production compression thresholds are unchanged; no benchmark input changes.

The stack starts with #5122; #5439 registers the scenario only after the shared support and harness fixes.

All-file uvx pre-commit run --all-files passed; all commits have DCO sign-off. Full repository CI has not been validated. Smoke runs use real pinned harness runtimes and a controlled local model provider; they do not qualify remote sandbox infrastructure or model quality.

Rebase validation — 2026-11-02

Rebased onto main 0c7ac5119c99e0aa0dfeda7be59157c589680ffd, preserving the existing stack order. Fresh compaction on the pinned Hermes runtime passes all five behavioral checks: 16 calls, 15 policy turns, one event, summary reuse and retained helper usage. This PR’s own patch is unchanged. All-file pre-commit passed on both stack tips; commits have DCO sign-off and SSH signatures. These are local pinned-runtime runs with a controlled provider, not remote deployment or full repository CI qualification.

@giuliolovisotto giuliolovisotto added bug Something isn't working area:agent Agent harnesses and Responses API agent behavior needs-review PR is ready for code review and waiting on a reviewer labels Oct 29, 2026
@nemo-automation-bot
nemo-automation-bot Bot requested a review from a team October 29, 2026 13:45
@github-actions github-actions Bot added the sla:triage-overdue Review assignment is over the one-business-day SLA label Oct 30, 2026
@giuliolovisotto
giuliolovisotto removed this pull request from stack #5312 November 2, 2026 10:16
marta-sd
marta-sd previously approved these changes Nov 2, 2026
marta-sd
marta-sd previously approved these changes Nov 3, 2026
@github-actions

github-actions Bot commented Nov 4, 2026

Copy link
Copy Markdown
Contributor

🔄 Merge queue validation started! You can track the progress here: https://github.com/NVIDIA-NeMo/Gym/actions/runs/41807702558

This branch was previously deployed

1 inactive deployment
public — 438da6ef Deployed Nov 4, 2026 by copy-pr-bot[bot] via release / finalize / notify #9929
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 needs-review PR is ready for code review and waiting on a reviewer

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants