Skip to content

fix(compression): make manual compression feedback truthful - #6944

Closed
bobashopcashier wants to merge 2 commits into
NousResearch:mainfrom
bobashopcashier:fix/6202-compress-response-truthfulness
Closed

fix(compression): make manual compression feedback truthful#6944
bobashopcashier wants to merge 2 commits into
NousResearch:mainfrom
bobashopcashier:fix/6202-compress-response-truthfulness

Conversation

@bobashopcashier

@bobashopcashier bobashopcashier commented Apr 10, 2026

Copy link
Copy Markdown
Contributor

What does this PR do?

Makes manual compression feedback truthful across both user-facing entrypoints: gateway /compress and CLI manual compression. No-op results are detected by comparing the pre/post transcript, token counts are labeled as rough transcript estimates, and cases where fewer messages still yield a higher rough estimate get an explicit explanatory note instead of misleading success copy.

Related Issue

Fixes #6202
Fixes #6217
Related: #6270
Separate env/pairing hardening is tracked in PR #6956

Type of Change

  • 🐛 Bug fix (non-breaking change that fixes an issue)
  • ✨ New feature (non-breaking change that adds functionality)
  • 🔒 Security fix
  • 📝 Documentation update
  • ✅ Tests (adding or improving test coverage)
  • ♻️ Refactor (no behavior change)
  • 🎯 New skill (bundled or hub)

Changes Made

  • added a shared manual-compression feedback formatter so gateway and CLI use the same no-op detection and estimate wording
  • updated gateway/run.py to report no-op compression truthfully and explain rough transcript estimate increases after summary rewrites
  • updated cli.py so manual compression uses the same truthful messaging instead of always printing a success banner
  • added focused regression coverage for gateway /compress and CLI manual compression output

How to Test

  1. Run /Users/kennyxie/Documents/Code/clawspace/hermes-agent/.venv/bin/python -m pytest tests/gateway/test_compress_command.py tests/cli/test_manual_compress.py -q
  2. Trigger manual compression on an unchanged transcript and verify Hermes reports a no-op rather than a successful compression
  3. Trigger manual compression on a transcript that compresses to fewer messages but a higher rough estimate and verify Hermes explains why

Checklist

Code

  • I've read the Contributing Guide
  • My commit messages follow Conventional Commits (fix(scope):, feat(scope):, etc.)
  • I searched for existing PRs to make sure this isn't a duplicate
  • My PR contains only changes related to this fix/feature (no unrelated commits)
  • I've run pytest tests/ -q and all tests pass
  • I've added tests for my changes (required for bug fixes, strongly encouraged for features)
  • I've tested on my platform: macOS 26.4

Documentation & Housekeeping

  • I've updated relevant documentation (README, docs/, docstrings) — or N/A
  • I've updated cli-config.yaml.example if I added/changed config keys — or N/A
  • I've updated CONTRIBUTING.md or AGENTS.md if I changed architecture or workflows — or N/A
  • I've considered cross-platform impact (Windows, macOS) per the compatibility guide — or N/A
  • I've updated tool descriptions/schemas if I changed tool behavior — or N/A

Screenshots / Logs

  • /Users/kennyxie/Documents/Code/clawspace/hermes-agent/.venv/bin/python -m pytest tests/gateway/test_compress_command.py tests/cli/test_manual_compress.py -q4 passed

@bobashopcashier bobashopcashier changed the title fix(gateway): make compress responses truthful fix(compression): make manual compression feedback truthful Apr 10, 2026
@bobashopcashier
bobashopcashier force-pushed the fix/6202-compress-response-truthfulness branch from b06576e to 9b2fbd5 Compare April 10, 2026 06:30
@bobashopcashier
bobashopcashier force-pushed the fix/6202-compress-response-truthfulness branch from 9b2fbd5 to e4fb524 Compare April 10, 2026 06:33
@teknium1

Copy link
Copy Markdown
Contributor

Merged via #7541 with authorship preserved. Thanks for the contribution!

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

Labels

None yet

Projects

None yet

2 participants