feat(image-gen): honor image_gen.model from config.yaml in plugin dispatch#19376
feat(image-gen): honor image_gen.model from config.yaml in plugin dispatch#19376kowenhaoai wants to merge 1 commit into
Conversation
…patch
Image generation plugins were dispatched without a model name, leaving
the plugin to pick its default. Users on OpenRouter, ComfyUI, or custom
backends had no way to select a specific model through config — they
had to fork the plugin or patch the tool.
Add _read_configured_image_model() that reads image_gen.model from the
active profile's config.yaml and forwards it into
_dispatch_to_plugin_provider(). When model is set, the plugin call
gains a 'model' kwarg; when unset, the plugin falls back to its own
default, so single-model users see no behavior change.
Example config:
image_gen:
provider: openrouter
model: flux-pro
Tests: all 170 image tool tests pass. The new code path is opt-in via
config and no existing test exercises it, so the change is strictly
additive.
|
Hi — polite maintainer ping on this one when you have a moment. 🙏 Context: this is the companion to #19375. It's purely additive (opt-in via Thanks! |
|
Flagging a related pair while doing due-diligence on duplicates: #18793 (issue) + #18796 (fix). They tackle an adjacent slice of the same problem — third-party OpenAI-compatible backends that need a non-default model identifier. The design choices are different:
They're not strictly conflicting — mine adds a tool-level pass-through, #18796 adds plugin-internal resolution for OpenAI specifically. But if the maintainer prefers one style over the other, some consolidation might make sense. No strong opinion from my side; happy to:
The original issue #18793 actually lists "Option A: Allow Not asking for a decision right now — just tagging the thread so reviewers have the full picture. |
Summary
The image generation tool dispatches to plugin providers without a
modelargument, leaving the plugin to pick its default. Users on OpenRouter, ComfyUI, or custom backends have no config-level way to select a specific model — they have to fork the plugin or patch the tool.Change
_read_configured_image_model()that readsimage_gen.modelfrom the active profile's~/.hermes/config.yaml(profile-aware viaget_hermes_home())._dispatch_to_plugin_provider(), forward the resolved model into the plugin'sgenerate(**kwargs)call.image_gen.modelis unset, the plugin falls back to its own default, so existing users see zero behavior change.Config example
Test plan
pytest tests/tools -k image -q→ 170 passed, 7 skipped.image_gen.model: flux-pro, runhermes image-gen "..."— the plugin receivesflux-pro.image_gen.model— plugin uses its own default (backward compatible).Risk
Low. Purely additive: missing config → unchanged behavior. The only new code path is an opt-in config read.