hermes - ✅(Solved) Fix [Bug]: Compress command tips wrong [5 pull requests, 1 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
NousResearch/hermes-agent#20020Fetched 2026-05-06 06:39:11
View on GitHub
Comments
0
Participants
1
Timeline
12
Reactions
0
Participants
Timeline (top)
cross-referenced ×5labeled ×4referenced ×2closed ×1

Error Message

Additional Logs / Traceback (optional)

Root Cause

Root Cause Analysis (optional)

Fix Action

Fixed

PR fix notes

PR #20027: fix(gateway): correct compression guidance command

Description (problem / solution / changelog)

Summary

  • replace stale gateway context-overflow guidance that told users to run /compact
  • centralize the guidance text so the failed-turn and exception paths stay aligned
  • add a regression test that requires /compress and rejects /compact

Fixes #20020

Tests

  • scripts/run_tests.sh tests/gateway/test_compress_command.py
  • git diff --check
  • rg -n "Use /compact|/compact to compress" gateway/run.py gateway tests/gateway/test_compress_command.py (no matches)

Changed files

  • gateway/run.py (modified, +10/-10)
  • tests/gateway/test_compress_command.py (modified, +9/-0)

PR #20057: fix: use correct /compress command name in context-overflow tips

Description (problem / solution / changelog)

What

Fix incorrect /compact command reference in context-overflow error messages and compression threshold tips. The actual command is /compress.

Fixes #20020

The Bug

When a session exceeds the model's context window, the gateway shows:

⚠️ Session too large for the model's context window.
Use /compact to compress the conversation, or /reset to start fresh.

But /compact is not a valid command — it's /compress. Users following this tip get "Unknown command" errors.

Similarly, the /context command's compression threshold tips in the ACP adapter say "Run /compact" instead of "Run /compress".

Why It Matters

This is a user-facing bug that affects all gateway platforms (Telegram, Discord, Slack, QQBot, etc.) and the ACP adapter (VS Code, Zed, JetBrains). When users hit context limits, they receive actionable but incorrect guidance, which is worse than no guidance at all.

Fix

Replace /compact with /compress in 4 user-facing locations:

FileLineContext
gateway/run.py6745Context-overflow error message (400 heuristic path)
gateway/run.py7073Context-overflow error message (400/500 status path)
acp_adapter/server.py1255/context compression-due tip
acp_adapter/server.py1270/context pre-threshold tip

Updated 2 test assertions in tests/acp/test_server.py and 1 docstring in tests/run_agent/test_1630_context_overflow_loop.py to match.

Before vs After

Before:

⚠️ Session too large for the model's context window.
Use /compact to compress the conversation, or /reset to start fresh.

(User types /compact → "Unknown command")

After:

⚠️ Session too large for the model's context window.
Use /compress to compress the conversation, or /reset to start fresh.

(User types /compress → compression runs successfully)

Tests

  • tests/acp/test_server.py — 6 context-related tests pass (2 assertions updated)
  • tests/run_agent/test_1630_context_overflow_loop.py — 16 tests pass (1 docstring updated)

Changed files

  • acp_adapter/server.py (modified, +2/-2)
  • gateway/run.py (modified, +2/-2)
  • tests/acp/test_server.py (modified, +2/-2)
  • tests/run_agent/test_1630_context_overflow_loop.py (modified, +1/-1)

PR #20163: fix(gateway): correct /compact to /compress in context overflow tips

Description (problem / solution / changelog)

Summary

The gateway error messages for context window overflow incorrectly reference /compact instead of the correct /compress slash command.

This affects all platforms (not just QQBot) since the error message is generated in the shared GatewayRunner in gateway/run.py.

Changes

  • gateway/run.py line ~6742: "/compact""/compress" in _is_ctx_fail error response
  • gateway/run.py line ~7070: "/compact""/compress" in status 400/500 error response for large sessions

Context

The registered slash command is /compress (defined in hermes_cli/commands.py), but the context overflow tips in gateway/run.py erroneously showed /compact. This confused users on all platforms, as reported in #20020 for QQBot.

Note: Slack does have /compact as a platform-specific alias for /compress, but the gateway error messages should reference the canonical command name.

Fixes #20020

Testing

  • 1233 gateway tests pass (6 pre-existing failures unrelated to this change)
  • Verified no other occurrences of "Use /compact" remain in Python files

Changed files

  • gateway/run.py (modified, +2/-2)

PR #20172: fix: salvage batch — compaction guidance, memory authority, eviction, summary boundary marker

Description (problem / solution / changelog)

Summary

Salvage four small compaction/compressor bug fixes from community PRs onto current main. All cherry-picked cleanly with contributor authorship preserved.

Changes

Original PRAuthorFixFiles
#20027@LeonSGP43Fix /compact/compress in context-overflow guidance (closes #20020). Centralized constant + regression test.gateway/run.py, tests/gateway/test_compress_command.py
#18767@MacroAnarchyEvict cached agent after compression so system prompt refreshes with latest skills/memory/SOUL.md. Two call sites: session hygiene + manual /compress.gateway/run.py
#17380@vominh1919Preserve memory authority across compaction. Changed "background reference" → "authoritative reference" wording in SUMMARY_PREFIX and memory block (closes #17251).agent/context_compressor.py, agent/memory_manager.py
#17121@wmagevMark end of summary in role=user fallback path with explicit boundary marker to prevent weak models from treating past user requests as fresh instructions. Adds new test.agent/context_compressor.py, tests/agent/test_context_compressor.py

PR #9262 excluded

PR #9262 (protect latest user message anchor) was skipped — the feature already exists on main via _ensure_last_user_message_in_tail() (commit f19ca50cd), and the PR branch is 3715 commits behind with a destructive full-file diff.

Test plan

tests/gateway/test_compress_command.py     — 1 passed
tests/agent/test_context_compressor.py     — 72 passed (including new test_user_role_summary_carries_end_marker)
tests/agent/test_memory_provider.py        — 68 passed
tests/agent/test_streaming_context_scrubber.py — 11 passed
tests/run_agent/test_1630_context_overflow_loop.py — 16 passed
──────────────────────────────────────────────────────
Total: 168 passed, 0 failed

Changed files

  • agent/context_compressor.py (modified, +17/-1)
  • agent/memory_manager.py (modified, +3/-2)
  • gateway/run.py (modified, +19/-10)
  • scripts/release.py (modified, +3/-0)
  • tests/agent/test_context_compressor.py (modified, +38/-0)
  • tests/gateway/test_compress_command.py (modified, +9/-0)

PR #20579: fix: salvage batch — compaction guidance, memory authority, cache eviction after compression

Description (problem / solution / changelog)

Summary

Salvage three small compaction/compressor bug fixes from community PRs onto current main. All applied as clean patches with contributor credit preserved.

Changes

Original PRAuthorFixFiles
#20027@LeonSGP43Fix /compact/compress in context-overflow guidance (closes #20020). Two locations: _normalize_empty_agent_response() and the exception handler return path.gateway/run.py
#18767@MacroAnarchyEvict cached agent after compression so system prompt refreshes with latest skills/memory/SOUL.md. Two call sites: session hygiene finally + manual /compress finally.gateway/run.py
#17380@vominh1919Preserve memory authority across compaction. Changed "background reference data" → "authoritative reference data" in SUMMARY_PREFIX, compression note, and memory block. Backward-compatible regex.agent/context_compressor.py, agent/memory_manager.py

Excluded from this batch

  • #17121 (boundary marker) — already merged to main in commit 2eef395e1 by @wmagev
  • #9262 (user-message anchoring) — already on main via _ensure_last_user_message_in_tail() (commit f19ca50cd)

Test plan

tests/gateway/test_compress_command.py    — 4 passed
tests/agent/test_context_compressor.py    — 68 passed
tests/agent/test_memory_provider.py       — 68 passed
tests/agent/test_streaming_context_scrubber.py — 11 passed
───────────────────────────────────────────
Total: 151 passed, 0 failed

Closes #20020

Changed files

  • agent/context_compressor.py (modified, +4/-1)
  • agent/memory_manager.py (modified, +3/-2)
  • gateway/run.py (modified, +7/-0)
  • scripts/release.py (modified, +2/-0)

Code Example

None

---
RAW_BUFFERClick to expand / collapse

Bug Description

When receiving compact tips from qqbot, the tips says /compact, but the right command should be /compress <img width="485" height="92" alt="Image" src="https://github.com/user-attachments/assets/b1a992bf-6e3d-4026-8838-55989d33cf00" />

Steps to Reproduce

  1. Run in a large session to receive compact reminder
  2. input /compact get
<img width="935" height="42" alt="Image" src="https://github.com/user-attachments/assets/40a69972-4c37-4a9c-8b3a-c598209c41dd" /> 3. input /compress <img width="466" height="39" alt="Image" src="https://github.com/user-attachments/assets/7f55620d-3120-4d9b-b485-1a566dc5a25e" />

Expected Behavior

The command name in tips to be the sames as the command usable.

Actual Behavior

The command name in tips is not the same as the command usable.

Affected Component

Gateway (Telegram/Discord/Slack/WhatsApp)

Messaging Platform (if gateway-related)

No response

Debug Report

None

Operating System

Windows

Python Version

No response

Hermes Version

No response

Additional Logs / Traceback (optional)

Root Cause Analysis (optional)

No response

Proposed Fix (optional)

No response

Are you willing to submit a PR for this?

  • I'd like to fix this myself and submit a PR

extent analysis

TL;DR

Update the command name in the compact tips to match the actual command /compress.

Guidance

  • Verify that the issue is caused by a mismatch between the command name in the tips and the actual command by checking the code that generates the tips.
  • Check the code for any hardcoded references to /compact and update them to /compress if necessary.
  • Test the updated code to ensure that the correct command name is displayed in the tips.
  • Consider adding a check to ensure that the command name in the tips matches the actual command to prevent similar issues in the future.

Notes

The issue seems to be a simple text mismatch, but without more information about the codebase, it's difficult to provide a more specific solution.

Recommendation

Apply workaround: update the command name in the compact tips to match the actual command /compress, as this is a straightforward fix that can be implemented quickly.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

hermes - ✅(Solved) Fix [Bug]: Compress command tips wrong [5 pull requests, 1 participants]