Skip to content

Picked image model now reaches xAI generation; OpenRouter picker lists all live image models (salvage #55893) - #89890

Merged
teknium1 merged 2 commits into
mainfrom
fix/xai-image-model-kwarg
Aug 19, 2026
Merged

teknium1 merged 2 commits into
mainfrom
fix/xai-image-model-kwarg

Conversation

@teknium1

Copy link
Copy Markdown
Collaborator

Summary

The image model a user picks in hermes tools now actually reaches xAI generation (salvage #55893 by @srojk34), and the OpenRouter/Nous image picker lists every image-output model the endpoint serves live — so new models (like the openrouter.ai/models?output_modalities=image set) are selectable the day they release, with no code change.

Follow-up to #89841, which introduced the live xAI catalog; this extends live-catalog treatment to OpenRouter/Nous and closes the model-selection propagation gap.

Changes

  • plugins/image_gen/xai: _resolve_model() accepts the dispatched model kwarg at top precedence (salvaged fix(xai): forward image_gen.model kwarg to _resolve_model in generate() #55893, rebased onto the live-catalog resolver; validation now against the merged live+static catalog); edit path (_resolve_edit_model) honors the same kwarg when the model is image-input capable
  • plugins/image_gen/openrouter: list_models() fetches the endpoint's /models filtered to output_modalitiesimage (per-backend 5-min cache, 10s timeout, openrouter/auto* pseudo-models excluded, static 2-model chain offline fallback); shared class means Nous Portal gets it too
  • Tests: kwarg-forwarding coverage (salvaged), live-catalog filtering/exclusion/ordering, cache single-fetch, offline fallback, edit-kwarg forwarding with text-only negative case

Validation

Before After
xAI: image_gen.model from hermes tools silently dropped, always default honored in generation and (if edit-capable) edits
OpenRouter picker rows 2 hardcoded 9 live image-output models (matches openrouter.ai listing)
Future OpenRouter/xAI image model code change required appears automatically
Targeted tests 59 passed (xai + openrouter suites); 9 pre-existing unrelated fails on untouched siblings reproduce identically on bare origin/main (minimal-venv SDK gaps)

Infographic

Live model catalogs for image pickers

srojk34 and others added 2 commits August 19, 2026 01:39
…t model; xAI edits honor dispatched model

- plugins/image_gen/openrouter: list_models() now queries the endpoint's
  /models catalog filtered to output_modalities containing "image"
  (per-backend 5-min cache, 10s timeout, static 2-model chain as offline
  fallback; openrouter/auto* router pseudo-models excluded). Every image
  model OpenRouter serves — including future releases — is selectable in
  `hermes tools` with no code change. Applies to Nous Portal too via the
  shared provider class.
- plugins/image_gen/xai: forward the dispatched model kwarg into
  _resolve_edit_model() so an explicitly selected edit-capable model is
  honored on /images/edits (extends the salvaged #55893 fix to the edit
  path; text-only models still fall back to quality).
- Tests: OpenRouter live-catalog filtering/exclusions/order, offline
  fallback, cache single-fetch; xAI edit-kwarg forwarding incl. the
  text-only-hijack negative case.

Live-verified against openrouter.ai: 9 image-output models returned and
rendered, matching the public models?output_modalities=image listing.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/plugins Plugin system and bundled plugins P3 Low — cosmetic, nice to have provider/nous Nous Research API (OAuth) provider/openrouter OpenRouter aggregator provider/xai xAI (Grok) tool/vision Vision analysis and image generation type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants