fix(gateway): don't upcast non-image attachments to image on PHOTO events - #50146
Closed
arminanton wants to merge 1 commit into
Closed
fix(gateway): don't upcast non-image attachments to image on PHOTO events#50146arminanton wants to merge 1 commit into
arminanton wants to merge 1 commit into
Conversation
…ents _build_media_placeholder and the image_paths collector classified any attachment on a MessageType.PHOTO event as an image, even when its MIME type was text/* or application/* (a document) or it was part of a mixed album. That mislabels documents as images and routes them into the vision pipeline. Classify by MIME first; only fall back to the PHOTO message_type when MIME is absent/ambiguous, and even then require an image extension or a single attachment with empty/octet-stream MIME before treating it as an image. 6 focused tests cover image MIME, text/application documents under PHOTO, mixed albums, single missing-MIME image-ext, and audio/video.
arminanton
added a commit
to arminanton/hermes-agent
that referenced
this pull request
Jun 21, 2026
…lines doc Council demands: - NousResearch#1 end-to-end replay: stacked 38/39 PRs on clean v0.17.0; the only 10 non-literal lines are my OWN intentional fixes (encoding-safe I/O NousResearch#50033/NousResearch#50064, public-value test NousResearch#50078) — replay tree is a SUPERSET of overlay intent, 0 lost. - NousResearch#3 independent spot-check via PLAIN git apply (not my scripts): NousResearch#48024/NousResearch#50146/NousResearch#50046 all apply clean exit 0. - NousResearch#4 the 3 deleted test_model_metadata lines documented findably here + in complete_diff_coverage.md (overlay's private-900K deletion, public PR keeps 272K).
arminanton
added a commit
to arminanton/hermes-agent
that referenced
this pull request
Jun 22, 2026
…rdict Each open PR replayed onto v0.17.0 + tests run. Verdict per PR (not just coverage): 34 clean apply + tests/code-only; 6 conflict PRs with verified v0.17.0 patches; the 5 with failures root-caused (NousResearch#50066/NousResearch#50086 pre-existing v0.17.0 flake reproduced on clean v0.17.0; NousResearch#50031/NousResearch#50032/NousResearch#50078 declared stack-deps that pass on full overlay). NousResearch#50146 + NousResearch#50155 (secondary co-owners, previously only co-listed) now individually verified: CLEAN apply + 6 passed each. 0 PRs left needing review.
Contributor
|
Thanks for isolating the mixed-attachment failure. This automated hermes-sweeper review finds that current
Closing as implemented on main. |
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.
Summary
_build_media_placeholderand theimage_pathscollector ingateway/run.pyclassified any attachment on a
MessageType.PHOTOevent as an image — evenwhen its MIME type was
text/*orapplication/*(a document), or it was partof a mixed album. That mislabels documents as images and routes them into the
vision/image-preprocessing pipeline.
Fix
Classify by MIME first; only fall back to the
PHOTOmessage_type when MIME isabsent/ambiguous, and even then require an image extension or a single
attachment with empty/
application/octet-streamMIME before treating it as animage. Albums/documents are no longer upcast.
Tests
tests/gateway/test_media_image_classification.py(6 cases): image MIME,text/application documents under PHOTO, mixed albums, single missing-MIME with
image extension, and audio/video classification. All pass.
Built on v0.17.0 (
2bd1977d); net diff applies--3wayonto the current base.