hermes-agent/tests/agent
Shashwat Gokhe 505bc27d8d fix(gateway): classify mixed attachments per-attachment + transcode uncommon image formats
A document attached alongside an image in the same Discord message was
swept into the vision pipeline and 400'd the whole turn ("Could not
process image"), and was simultaneously never surfaced to the agent as a
readable file. Restores the "any file type works" contract for mixed
messages and fixes the HTTP 400.

Bug 1 — mixed attachments: the inbound routing loop keyed image/audio/video
classification off the message-level type (PHOTO/VOICE/AUDIO), so a doc in
a PHOTO message landed in image_paths and poisoned the vision call. The
document context-note path was gated on message_type == DOCUMENT, so that
same doc never reached the agent at all. Now classification is
per-attachment (trust each attachment's own MIME; fall back to the
message-level type only when MIME is unknown), via shared _event_media_is_*
helpers used by both _build_media_placeholder and the main inbound loop.
The document note now fires for any non-image/audio/video attachment
regardless of message-level type.

Bug 2 — uncommon formats: AVIF/HEIC/BMP/TIFF/ICO produced the same generic
400 because providers only accept PNG/JPEG/GIF/WEBP. image_routing now
transcodes those to PNG via Pillow before declaring media_type, skipping
cleanly (logged) if Pillow/plugins are missing. SVG is vector — Pillow
can't rasterize it — so it's skipped rather than transcoded.

Closes #25935.

Co-authored-by: LeonSGP43 <cine.dreamer.one@gmail.com>
Co-authored-by: cypres0099 <74935762+cypres0099@users.noreply.github.com>
2026-06-27 19:26:04 -07:00
..
lsp
…
transports fix(cache): content-address prompt_cache_key so recurring cron jobs reuse the warm prefix (#52295) 2026-06-24 21:46:30 -07:00
__init__.py
…
test_anthropic_adapter.py fix(anthropic): stop SDK auto-retry double-firing and raise Retry-After cap to 600s 2026-06-27 19:23:15 -07:00
test_anthropic_keychain.py fix(anthropic): adopt Claude Code's already-refreshed token before racing refresh 2026-06-27 19:14:43 -07:00
test_anthropic_kwargs_sanitize.py
…
test_anthropic_mcp_prefix_strip.py
…
test_anthropic_oauth_pkce.py test(anthropic-oauth): cover login token-endpoint host + fallback 2026-06-23 23:59:40 -07:00
test_anthropic_output_field_leak.py
…
test_anthropic_thinking_block_order.py
…
test_arcee_trinity_overrides.py
…
test_async_utils.py fix(ci): rip out some xdist legacy stuff... how did these ever work?? 2026-06-26 19:15:18 -07:00
test_auxiliary_client.py fix(auxiliary): fall back to OPENROUTER_API_KEY when credential pool exhausted 2026-06-27 19:09:27 -07:00
test_auxiliary_client_anthropic_custom.py
…
test_auxiliary_client_azure_foundry.py
…
test_auxiliary_client_base_url_host_validation_52608.py fix(auxiliary): gate Anthropic base_url override on Anthropic-compatible host (#52608) 2026-06-26 11:21:05 +05:30
test_auxiliary_client_xai_oauth_recovery.py
…
test_auxiliary_config_bridge.py
…
test_auxiliary_main_first.py fix(moa): resolve auxiliary tasks to the aggregator, not the preset name (#53827) 2026-06-27 14:21:26 -07:00
test_auxiliary_named_custom_providers.py
…
test_auxiliary_transport_autodetect.py
…
test_auxiliary_user_default_headers.py
…
test_azure_identity_adapter.py
…
test_bedrock_1m_context.py
…
test_bedrock_adapter.py
…
test_bedrock_integration.py
…
test_billing_view.py
…
test_cascading_interrupt_6600.py
…
test_chat_completion_helpers_provider_sort.py fix(agent): validate OpenRouter provider sort before request dispatch 2026-06-27 11:43:08 -07:00
test_close_interrupted_tool_sequence.py fix(agent): close tool-call sequence on all interrupt aborts, not just finalize_turn 2026-06-25 12:24:34 -05:00
test_codex_cloudflare_headers.py
…
test_codex_responses_adapter.py
…
test_codex_ttfb_watchdog.py
…
test_coding_context.py fix(agent): require code for coding posture 2026-06-25 16:40:27 -05:00
test_compress_focus.py
…
test_compressed_summary_metadata.py
…
test_compression_concurrent_fork.py test(compression): pin rotation-fallback tests to in_place=False ahead of default flip 2026-06-25 12:56:05 -07:00
test_compression_count_warning_36908.py fix(agent): route repeated-compression warning through _emit_status (#36908) 2026-06-21 11:34:47 -07:00
test_compression_interrupt_protection.py fix(compression): protect the summary call from mid-flight interrupts 2026-06-20 21:32:30 -07:00
test_compression_logging_session_context.py test(compression): pin rotation-fallback tests to in_place=False ahead of default flip 2026-06-25 12:56:05 -07:00
test_compression_progress.py fix(agent): align preflight token-progress floor to 5% (#23767, #39548) 2026-06-22 15:51:52 +05:30
test_compression_rotation_state.py test(compression): pin rotation-fallback tests to in_place=False ahead of default flip 2026-06-25 12:56:05 -07:00
test_compressor_assistant_tail_anchor.py
…
test_compressor_historical_media.py
…
test_compressor_image_tokens.py
…
test_compressor_media_stripping.py
…
test_compressor_tool_call_budget.py fix(compressor): count tool_call envelope in tail-budget token estimate (#28053) 2026-06-22 16:26:56 +05:30
test_context_compressor.py fix(compression): abort (preserve context) on transient network summary failure (#29559, #25585) 2026-06-24 18:31:51 +05:30
test_context_compressor_cross_session_guard.py
…
test_context_compressor_summary_continuity.py
…
test_context_compressor_temporal_anchoring.py
…
test_context_engine.py fix(agent): deepcopy plugin context engine to prevent parent corruption on delegate_task (#42449) 2026-06-25 02:13:26 +05:30
test_context_engine_host_contract.py
…
test_context_references.py
…
test_copilot_acp_client.py
…
test_copilot_acp_deprecation.py
…
test_credential_pool.py fix(auth): preserve concurrently-added credentials on pool rewrite 2026-06-27 19:01:37 -07:00
test_credential_pool_oauth_writethrough.py fix(auth): write rotated Codex/xAI pool grant through to global root (#48415) (#52760) 2026-06-25 19:14:06 -07:00
test_credential_pool_routing.py
…
test_credits_cold_start.py
…
test_credits_fixture_snapshot.py
…
test_credits_policy.py
…
test_credits_tracker.py
…
test_credits_view.py
…
test_crossloop_client_cache.py
…
test_curator.py test(curator): join straggler curator-review thread on fixture teardown 2026-06-27 03:52:52 -07:00
test_curator_activity.py
…
test_curator_backup.py
…
test_curator_classification.py
…
test_curator_reports.py
…
test_custom_pool_mismatch_guard.py
…
test_custom_provider_extra_body.py fix: handle named custom providers and Z.AI overload retries 2026-06-25 00:17:17 -07:00
test_custom_providers_vision.py
…
test_deepseek_anthropic_thinking.py
…
test_direct_provider_url_detection.py
…
test_display.py fix(browser): force secret-pattern redaction on browser_type display 2026-06-25 22:02:22 -07:00
test_display_emoji.py
…
test_display_todo_progress.py
…
test_display_tool_failure.py
…
test_empty_tool_name_loop_dampening.py
…
test_error_classifier.py fix(agent): classify 429 'overloaded' bodies as overloaded, not rate_limit 2026-06-27 04:16:54 -07:00
test_external_skills.py
…
test_external_skills_dirs_cache.py
…
test_failover_identity.py fix(agent): keep system-prompt model identity in sync across provider failover 2026-06-20 10:46:01 -07:00
test_file_safety.py
…
test_file_safety_container_mirror.py
…
test_file_safety_credentials.py
…
test_file_safety_cross_profile.py
…
test_file_safety_sandbox_mirror.py
…
test_gemini_fast_fallback.py feat(providers): remove google-gemini-cli + google-antigravity OAuth providers (#50492) 2026-06-21 19:53:27 -07:00
test_gemini_free_tier_gate.py
…
test_gemini_native_adapter.py
…
test_gemini_schema.py
…
test_i18n.py
…
test_image_gen_registry.py
…
test_image_routing.py fix(gateway): classify mixed attachments per-attachment + transcode uncommon image formats 2026-06-27 19:26:04 -07:00
test_insights.py
…
test_jiter_preload.py
…
test_kimi_coding_anthropic_thinking.py
…
test_last_total_tokens.py
…
test_learn_prompt.py fix(learn): name distilled skills as author Hermes, not the host OS user (#52388) 2026-06-25 12:48:08 -07:00
test_local_stream_timeout.py
…
test_markdown_tables.py
…
test_memory_async_sync.py
…
test_memory_provider.py fix(agent): validate context/memory tool schemas before wrapping 2026-06-25 02:17:29 +05:30
test_memory_session_switch.py
…
test_memory_skill_scaffolding.py
…
test_memory_user_id.py
…
test_memory_write_bridge.py refactor(memory): move write-mirror gating behind MemoryManager interface 2026-06-22 07:00:42 -07:00
test_message_content.py
…
test_minimax_auxiliary_url.py
…
test_minimax_provider.py
…
test_model_metadata.py fix(moa): resolve context window from the aggregator, not the 256K default (#53780) 2026-06-27 12:08:09 -07:00
test_model_metadata_local_ctx.py
…
test_model_metadata_ssl.py
…
test_models_dev.py
…
test_moonshot_schema.py
…
test_non_stream_stale_timeout.py
…
test_nous_credits_gauge.py
…
test_nous_credits_snapshot.py
…
test_nous_oauth_401_guidance.py
…
test_nous_rate_guard.py
…
test_onboarding.py
…
test_oneshot.py feat(agent): one-shot LLM helper + llm.oneshot gateway RPC (#51261) 2026-06-23 08:01:50 +00:00
test_openrouter_response_cache.py
…
test_pet_engine.py feat(pets): pet engine + display.pet config 2026-06-20 14:18:30 -05:00
test_pet_generate.py test(pets): make slow pet generation suite opt-in 2026-06-25 00:44:53 -05:00
test_platform_hint_overrides.py
…
test_plugin_llm.py
…
test_portal_tags.py
…
test_preflight_compression_gate.py fix(agent): trigger preflight compression on few-but-huge sessions (#27405) 2026-06-25 01:20:23 +05:30
test_prompt_builder.py fix(gateway): WhatsApp/Signal hints affirm markdown instead of forbidding it (#53564) 2026-06-27 03:46:41 -07:00
test_prompt_caching.py
…
test_proxy_and_url_validation.py
…
test_rate_limit_tracker.py
…
test_reasoning_stale_timeout_floor.py feat(agent): apply per-reasoning-model stale-timeout floor in stream + non-stream detectors 2026-06-25 22:12:06 -07:00
test_redact.py fix(redact): mask passwords in lowercase/dotted config keys (#53590) 2026-06-27 04:43:28 -07:00
test_resume_stale_active_task.py
…
test_runtime_cwd.py
…
test_save_url_image.py
…
test_secret_scope.py feat(gateway): multiplex phase 2 — fail-closed profile credential isolation (Workstream A) 2026-06-19 07:34:15 -07:00
test_set_runtime_main_custom_provider.py
…
test_shell_hooks.py
…
test_shell_hooks_consent.py
…
test_skill_bundles.py
…
test_skill_commands.py
…
test_skill_commands_reload.py fix(ci): rip out some xdist legacy stuff... how did these ever work?? 2026-06-26 19:15:18 -07:00
test_skill_utils.py fix(curator): protect external skills from background curation 2026-06-25 22:03:02 -07:00
test_ssl_ca_guard.py
…
test_stream_read_timeout_floor.py
…
test_streaming_context_scrubber.py
…
test_subagent_progress.py
…
test_subagent_stop_hook.py
…
test_subdirectory_hints.py
…
test_summary_prefix_semantics.py
…
test_system_prompt.py feat(tools): add project workspace tools 2026-06-25 16:40:27 -05:00
test_system_prompt_restore.py
…
test_think_scrubber.py
…
test_thinking_timeout_guidance.py fix(agent): detect thinking-timeout for reasoning models and surface actionable guidance instead of misleading file-write advice 2026-06-25 19:00:48 -07:00
test_title_generator.py feat(titles): support language-aware title generation (#45296) 2026-06-19 17:15:52 -07:00
test_tool_dispatch_helpers.py
…
test_tool_guardrails.py
…
test_tool_result_classification.py
…
test_transcription_registry.py
…
test_tts_registry.py
…
test_turn_context.py fix: persist non-NULL system prompt on fresh turn setup (#45499) (#52616) 2026-06-25 12:54:19 -07:00
test_turn_finalizer_cleanup_guard.py fix(agent): complete final text on last turn 2026-06-22 13:57:59 -07:00
test_turn_finalizer_interrupt_alternation.py test(agent): cover interrupt tool-tail alternation close (#48879) 2026-06-23 23:52:28 -07:00
test_turn_retry_state.py fix(agent): fail over to fallback provider on persistent auth failure (401/403) 2026-06-20 11:38:01 -07:00
test_unsupported_parameter_retry.py
…
test_unsupported_temperature_retry.py
…
test_usage_pricing.py fix(bedrock): price Claude prompt-cache tokens in /usage (#50307) 2026-06-21 11:48:43 -07:00
test_verification_evidence.py feat(agent): recognize focused ad-hoc verification scripts 2026-06-24 23:03:45 -05:00
test_verification_stop.py feat(verify-on-stop): default OFF, one-time migration, skip doc-only edits (#53552) 2026-06-27 03:23:22 -07:00
test_video_gen_registry.py
…
test_vision_resolved_args.py
…
test_vision_routing_31179.py
…