Repository navigation
Description
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(IDcustom:mygateway) auxiliary.visionis configured (another model on the same provider)agent.image_input_modeis not set (auto)
Steps to reproduce
-
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
-
Run the WebUI in gateway mode and pick
my-vision-modelfrom that provider in the model picker. The session stores the model as@custom:mygateway:my-vision-model. -
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):
- runs path, ~line 586:
_build_native_multimodal_message(..., active_model=(model or ""), ...) - chat-completions path, ~line 1122: same,
active_model=(model or "") - whereas the request body uses
"model": _gateway_model_field(model)(~lines 624 and 1127), which strips the prefix ([Bug] _clean_session_model_provider passes unsplit provider:model string as provider, causing 'Unknown provider' errors on non-workaround models #6722).
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: trueWith that entry, native image input works end to end (verified with real uploads).
Possibly related
- Bug: WebUI unconditionally embeds images as native image_url, bypassing image_input_mode config #1959 (closed): WebUI bypassing
image_input_mode. This issue is the opposite direction: a validsupports_visionis missed. - Bug: Attachment uploads use blob: URLs causing native image mode to fail #2631 (open): blob: URL uploads breaking native mode. Different cause; files here are on disk and readable.
Activity
nesquena-hermes commentedon Nov 19, 2026
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.
test(nesquena#9196): pin the documented verdict in the prefix parity …