Skip to content

Gateway mode: image routing receives the @provider:model session model, so supports_vision: true is missed and uploads fall back to text #9196

Open

Description

@lyft168

Summary

In gateway mode (HERMES_WEBUI_CHAT_BACKEND=gateway), when a session's model is stored in provider-qualified form (e.g. @custom:mygateway:my-vision-model), image uploads are never sent as native image parts even though the model is configured with supports_vision: true.

The request body strips the prefix via _gateway_model_field(), but the image-routing check gets the raw prefixed string. The capability lookup in agent.image_routing then searches for a model named @custom:mygateway:my-vision-model, finds nothing, and returns text. When auxiliary.vision is configured, _explicit_text_signal() makes the WebUI honour that, and the attachment reaches the model only as a file path in the message text.

Environment

  • hermes-webui: 0.52.264 (ghcr.io/nesquena/hermes-webui:latest, revision e168b67)
  • hermes-agent: nousresearch/hermes-agent:latest
  • Chat backend: gateway, runs API (/v1/runs)
  • Provider: an OpenAI-compatible endpoint defined under custom_providers (ID custom:mygateway)
  • auxiliary.vision is configured (another model on the same provider)
  • agent.image_input_mode is not set (auto)

Steps to reproduce

  1. Define a custom provider and mark a model as vision-capable:

    custom_providers:
      - name: mygateway
        base_url: https://example.invalid/v1
        models:
          my-vision-model: {}
    providers:
      mygateway:
        models:
          my-vision-model:
            supports_vision: true
    auxiliary:
      vision:
        provider: custom:mygateway
        model: some-other-vision-model
  2. Run the WebUI in gateway mode and pick my-vision-model from that provider in the model picker. The session stores the model as @custom:mygateway:my-vision-model.

  3. Attach a PNG screenshot and send.

Expected

_build_native_multimodal_message() returns native image_url parts and the model receives the image.

Actual

The model receives only text like [Attached files: /home/hermeswebui/.hermes/webui/attachments/<session>/screenshot-xxx.png]. The message stored by the gateway contains no image parts.

Evidence (run inside the hermes-webui container against the same config)

from api.streaming import _resolve_image_input_mode as r
r(cfg, "custom:mygateway", "my-vision-model", requested_provider="custom:mygateway")                    # -> "native"
r(cfg, "custom:mygateway", "@custom:mygateway:my-vision-model", requested_provider="custom:mygateway")  # -> "text"

The only difference is the @provider: prefix on active_model.

Where it happens

api/gateway_chat.py (v0.52.264):

active_model flows into api/streaming.py: _resolve_image_input_mode(), which calls agent.image_routing.decide_image_input_mode() / _lookup_supports_vision() with the prefixed name.

Suggested fix

Normalise the model the same way for the image check as for the request body, e.g.:

active_model=_gateway_model_field(model)

at both call sites. Alternatively, strip the prefix inside _resolve_image_input_mode() using _parse_provider_qualified_model_id(), so every caller is covered.

Workaround

Add a second capability entry keyed by the prefixed name:

providers:
  mygateway:
    models:
      my-vision-model:
        supports_vision: true
      "@custom:mygateway:my-vision-model":
        supports_vision: true

With that entry, native image input works end to end (verified with real uploads).

Possibly related

Activity

  1. added
    bug
    gateway
    investigation
    on Nov 19, 2026
  2. nesquena-hermes commented on Nov 19, 2026

    @nesquena-hermes
    Collaborator

    Thanks @lyft168 — the bare-versus-qualified comparison is useful. Both Gateway attachment paths on current master still pass the stored model string to image-capability routing, separately from the model-name normalization used for the request body, so this remains a plausible current defect rather than a confirmed duplicate.

    I have not reproduced the upload end to end with your Agent build. Could you share its exact version/commit or image digest, and whether the same upload still falls back to text on a current WebUI build? Please omit credentials, private endpoints and image contents. The reported capability-entry workaround is useful evidence, but not a complete fix; both Gateway transports and the explicit image-input settings need to retain their intended behavior.

  3. added a commit that references this issue on Nov 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    buggatewayinvestigationneedinfo

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions