fix(agent): increment ineffective counter on no-op compression (#36624) - #38723
Closed
ashishpatel26 wants to merge 3 commits into
Closed
fix(agent): increment ineffective counter on no-op compression (#36624)#38723ashishpatel26 wants to merge 3 commits into
ashishpatel26 wants to merge 3 commits into
Conversation
ashishpatel26
force-pushed
the
fix/compression-exhaustion-noop-36624
branch
from
June 5, 2026 04:09
46a52c4 to
f34b676
Compare
13 tasks
When compress_start >= compress_end (token-budget tail covers all compressible messages), compress() returned early without incrementing _ineffective_compression_count. The anti-thrash guard (>= 2 consecutive) never fired, so tool-heavy sessions looped until provider 413/context error. Fix: increment counter and warn on no-op path. Closes NousResearch#36624
…ath traversal) sync_back inferred host paths for new remote files under mapped parent directories without any allowlist check, allowing a malicious remote task to write files into ~/.hermes/skills/, ~/.hermes/plugins/, or sensitive config files by creating them on the remote side. Add _is_safe_sync_back_target() that denies writes to skill dirs, plugin dirs, config.yaml, and .env. Also add a symlink-escape check that rejects any resolved path escaping its mapped directory parent. Closes NousResearch#38026
ashishpatel26
force-pushed
the
fix/compression-exhaustion-noop-36624
branch
from
June 12, 2026 18:52
f34b676 to
1d2750f
Compare
Contributor
|
Thanks for this — closing as already-implemented on current main. For #36624, the no-op ineffective-compression counter you proposed already landed on main via b18490b (#40803), which increments _ineffective_compression_count when the transcript fits the tail budget and bails after 2 ineffective passes. Your diagnosis matched the root cause; the fix shipped via the referenced commit. Appreciate the contribution. |
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.
Closes #36624. When compress_start >= compress_end (token-budget tail covers all compressible messages), compress() returned early without incrementing _ineffective_compression_count. Anti-thrash guard never fired; tool-heavy sessions looped until provider 413. Fix: increment counter and warn on no-op path. Adds 2 regression tests.