fix(compression): skip empty post-handoff summary windows - #59526
fix(compression): skip empty post-handoff summary windows#59526WOLIKIMCHENG wants to merge 1 commit into
Conversation
|
Thanks for the focused regression fix. Current The proposed early return mirrors the established no-compressible-window accounting at This is an automated hermes-sweeper review. |
|
Merged via salvage PR #70251 with your commit cherry-picked and authorship preserved — thanks @WOLIKIMCHENG! Your empty-post-handoff-window guard (with the regression test) now ships on main; the only adaptation was routing the ineffective-strike through |
What does this PR do?
Skips context summary generation when the latest handoff summary leaves no new turns after compression boundary adjustment.
This avoids calling
_generate_summary([])/ the configured context engine with an empty input window, which currently produces a noisy compression-aborted warning while preserving the transcript unchanged.Related Issue
Fixes #59496
Type of Change
Changes Made
agent/context_compressor.py: add a post-handoff empty-window guard that records ineffective compression and returns without calling_generate_summary.tests/agent/test_context_compressor_summary_continuity.py: add a regression test proving_generate_summaryis not called when the latest handoff consumes the compression window.How to Test
python -m pytest tests/agent/test_context_compressor_summary_continuity.py -qpython -m pytest tests/agent/test_context_compressor_cross_session_guard.py -qpython -m pytest tests/agent/test_context_compressor.py tests/run_agent/test_infinite_compaction_loop.py -qpython -m py_compile agent/context_compressor.py tests/agent/test_context_compressor_summary_continuity.pygit diff --check -- agent/context_compressor.py tests/agent/test_context_compressor_summary_continuity.pyNotes:
scripts/run_tests.sh --files ...could not run locally because this checkout has no.venvorvenv.ruffwas not available locally.Checklist
Code
fix(scope):,feat(scope):, etc.)pytest tests/ -qand all tests passDocumentation & Housekeeping
docs/, docstrings) — N/Acli-config.yaml.exampleif I added/changed config keys — N/ACONTRIBUTING.mdorAGENTS.mdif I changed architecture or workflows — N/AScreenshots / Logs
N/A — covered by regression tests.