fix(telegram): fail fast when user images cannot be accessed (rebase for moved file) - #63635
HiddenPuppy wants to merge 2 commits into
Conversation
…for moved file) Cherry-pick of PR NousResearch#22413 logic onto current main. Changes: - MIME normalization image/jpg → image/jpeg in plugins/platforms/telegram/adapter.py (file was moved from gateway/platforms/telegram.py) - _build_media_placeholder: return neutral fallback when no media_urls exist - _enrich_message_with_vision: all_failed tracking + fail-fast message when all analyses fail and user provided no caption Fixes NousResearch#22385
Add four new test cases for the all-failed / fail-fast logic in _enrich_message_with_vision: - test_all_failed_no_caption_returns_failfast - test_all_failed_with_caption_returns_original - test_all_exception_no_caption_returns_failfast - test_mixed_success_failure_includes_user_text Requested by reviewer @teknium1.
|
Thanks for rebasing the fix onto the moved Telegram adapter. The no-caption fail-fast branch addresses a behavior that still exists on current main: Problems
Suggested changes
Automated hermes-sweeper review. |
|
suggesting changes The all-failed captioned-image path still preserves the retry loop this change is meant to stop. With
followed by the caption. That happens because the new fail-fast branch is gated by The new Security evidence:
Signed: GPT-5.6-sol-xhigh in Codex |
SummaryFourteen PRs address or reference this issue complex across four distinct causes: verbose or capped auxiliary-vision output, lost system prompts, transient auto-vision failures, and inaccessible-image retry loops. The diffs range from internal concise preprocessing and provider-cap propagation (#10852), persona forwarding (#25656), retries (#28999/#29263), fail-fast handling (#22413/#63635), user-facing token configuration (#15430/#29600/#38004/#73438/#74939/#74945), and removal of vision caps (#75253). Related pull requests
Duplicates#22413 is superseded by #63635; #61187 substantially duplicates #10852; #29263 duplicates #28999; #15430, #29600, #38004, #73438, #74939, and #74945 share the rejected user-facing Suggested consolidationKeep #63635 open with a salvage path, consistent with its automated keep-open verdict: the author should suppress Complex graphflowchart LR
classDef open fill:#dbeafe,stroke:#1d4ed8,color:#1e3a8a
classDef merged fill:#dcfce7,stroke:#15803d,color:#14532d
classDef closed fill:#e5e7eb,stroke:#6b7280,color:#1f2937
classDef unverified fill:#f3f4f6,stroke:#9ca3af,color:#374151
classDef best stroke-width:3px,stroke:#b45309
classDef target stroke-width:3px,stroke:#4338ca
I22385(["issue #22385 (closed)"])
I28972(["issue #28972 (open)"])
subgraph Dup22413 ["PRs duplicating each other"]
P22413["PR #22413 (open)"]
P63635["PR #63635 (open)"]
end
P63635 -->|best fix| I22385
P63635 -.->|partial| I28972
class I22385 closed
class I28972 open
class P22413 open
class P63635 open
class P63635 best
class P63635 target
click I22385 "https://github.com/NousResearch/hermes-agent/issues/22385"
click I28972 "https://github.com/NousResearch/hermes-agent/issues/28972"
click P22413 "https://github.com/NousResearch/hermes-agent/pull/22413"
click P63635 "https://github.com/NousResearch/hermes-agent/pull/63635"
Graph: solid arrow = fixes / best fix, dashed arrow = partial or unverified (see edge label); boxed group = PRs duplicating each other; amber border = best fix; indigo border = target; gray node = closed (state tag in the node label). Cross-PR triage: Reviewed 14 pull requests and 5 issues in this complex. Diffs were read for 13 of 14 PRs (rest unavailable); Assessment working set: 110 kB of PR diffs, 48 kB of issue/PR text, 15 kB of discussion (22 comments), 29 verify verdicts. verdicts reflect diff content, not PR titles. Part of an automated triage batch. |
Summary
Rebase of PR #22413 onto current main, resolving the file-move conflict.
The original PR modified
gateway/platforms/telegram.pywhich no longer exists on main — the Telegram adapter was moved toplugins/platforms/telegram/adapter.py. This PR transplants the MIME fix to the new location.Changes
plugins/platforms/telegram/adapter.pyimage/jpg→image/jpegusing standard MIME types (transplanted from oldgateway/platforms/telegram.py)gateway/run.py—_build_media_placeholdermedia_urlsexist, preventing empty user inputgateway/run.py—_enrich_message_with_visionall_failedacross all images. When ALL analyses fail AND the user provided no caption, return a clear fail-fast messagetests/gateway/test_vision_memory_leak.pyAddresses Review Feedback
Per @teknium1's review on PR #22413:
plugins/platforms/telegram/adapter.pytest_vision_memory_leak.pyFixes #22385
Closes #22413 (replaced by this rebased version)