fix(agent): accept dimension-correct image shrinks (#48013) - #48035
Closed
Tranquil-Flow wants to merge 1 commit into
Closed
fix(agent): accept dimension-correct image shrinks (#48013)#48035Tranquil-Flow wants to merge 1 commit into
Tranquil-Flow wants to merge 1 commit into
Conversation
This was referenced Jun 17, 2026
Contributor
|
Merged via #49140 (commit 990273d) — closes #48013. Your PR was submitted first and carried the same core idea (key the accept/reject gate on the binding constraint and accept a dimension-correct downscale). #49140 authors that approach cleanly against current |
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
Fixes #48013 by making image-shrink recovery evaluate success against the constraint that triggered the resize.
When Anthropic/OpenRouter reports the many-image 2000px dimension cap, Hermes already calls the shrink path with
max_dimension=2000. The bug was one layer lower:_shrink_data_urlrejected a dimension-correct PNG downscale if the re-encoded data URL was larger in bytes than the original, leaving oversized screenshots in the request and consuming the one-shot retry.How
max_dimensionand accept it even if bytes grew.Verification
Red/green proof:
test_dimension_shrink_with_byte_growth_acceptedfails withassert False is True./Users/evinova-self/.hermes/hermes-agent/venv/bin/python3 -m pytest tests/run_agent/test_image_shrink_recovery.py -v -o "addopts=" --tb=short19 passed, 1 warning in 1.00sPublication gates:
fix/48013*: none found.48013and distinctive image-dimension shrink terms: none found.Auto-published by Moonsong via Path B automated pipeline.