test(cli): accept force= kwarg on DummyAgent._compress_context - #28303
Closed
briandevans wants to merge 1 commit into
Closed
test(cli): accept force= kwarg on DummyAgent._compress_context#28303briandevans wants to merge 1 commit into
briandevans wants to merge 1 commit into
Conversation
PR NousResearch#28102 added a ``force=True`` argument to the manual /compress code path so users can bypass the auto-compress summary-failure cooldown. ``cli.HermesCLI._manual_compress`` now passes ``force=True`` when forwarding to ``agent._compress_context`` (cli.py:9194), but the ``DummyAgent._compress_context`` stub in test_cli_manual_compress.py doesn't accept ``force=``. Result on origin/main: the stub raises ``TypeError: got an unexpected keyword argument 'force'``, the try/except in _manual_compress prints ``❌ Compression failed`` and the conversation history is never replaced. The test then fails at ``assert len(cli.agent.calls) == 1`` because the append never ran. This shows up as a baseline failure on every open PR's CI. - Add ``force=False`` to the DummyAgent signature so the real ``cli._manual_compress`` call reaches the stub cleanly. - Capture ``force`` in the call record and assert ``call["force"] is True`` so the manual-/compress contract from NousResearch#28102 is now covered by an explicit regression check rather than masked by a TypeError.
Contributor
Author
|
Closing — superseded by commit 19128108a ( Thanks for batching the four stale-fixture fixes together — keeps the queue clean. |
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.
What does this PR do?
Aligns the
DummyAgent._compress_contextstub intests/test_cli_manual_compress.pywith the production signature after PR #28102 addedforce=Trueto the manual/compresscode path.Without this fix,
tests/test_cli_manual_compress.py::test_manual_compress_does_not_pass_cached_system_promptis a baseline failure on every open PR's CI. The CLI passesforce=True(cli.py:9194), the stub raisesTypeError: got an unexpected keyword argument 'force', the surroundingexcept Exceptionprints❌ Compression failed, and the test fails onassert len(cli.agent.calls) == 1because the append never ran.Related Issue
N/A — baseline CI fix surfaced by PR #28102 and observed on every open PR (e.g. https://github.com/NousResearch/hermes-agent/actions/runs/26068814560/job/76645496736).
Type of Change
Changes Made
tests/test_cli_manual_compress.py— addforce=FalsetoDummyAgent._compress_contextso the production call fromcli.HermesCLI._manual_compressreaches the stub cleanly. Captureforcein the call record and assertcall["force"] is Trueso the manual-/compresscontract from fix(compress): abort instead of dropping messages when summary LLM fails #28102 is covered by an explicit regression check rather than swallowed by theTypeError → except Exceptionpath.How to Test
origin/main:uv run --with pytest --with pytest-xdist --with pytest-asyncio python3 -m pytest tests/test_cli_manual_compress.py -v→ fails with
❌ Compression failed: DummyAgent._compress_context() got an unexpected keyword argument 'force'andassert 0 == 1.Checklist
Code
test(cli):)call["force"] is True)Documentation & Housekeeping
docs/, docstrings) — N/A, test-only changecli-config.yaml.exampleif I added/changed config keys — N/ACONTRIBUTING.mdorAGENTS.mdif I changed architecture or workflows — N/AScreenshots / Logs
Baseline failure on origin/main (from PR #24395's CI run, 2026-05-18):
Local run after this PR: