Skip to content

Fix stale OpenRouter image model defaults - #77238

Closed
zhuermu wants to merge 1 commit into
NousResearch:mainfrom
zhuermu:fix/openrouter-image-model-picker
Closed

Fix stale OpenRouter image model defaults#77238
zhuermu wants to merge 1 commit into
NousResearch:mainfrom
zhuermu:fix/openrouter-image-model-picker

Conversation

@zhuermu

@zhuermu zhuermu commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

Summary

  • keep the OpenRouter provider catalog default independent from runtime config overrides
  • fall back to the first catalog entry when both the saved and provider-default model IDs are stale
  • add regression coverage for cross-provider model settings and missing catalog defaults

Problem

Selecting OpenRouter after another image provider could leave image_gen.model set to a model such as gpt-image-2-medium. OpenRouter returned that configured value from default_model(), even though it was absent from list_models(), causing the setup picker to raise KeyError.

Testing

  • python3 -m pytest -q tests/plugins/image_gen/test_openrouter_compat_provider.py tests/hermes_cli/test_tools_config.py (51 passed)
  • git diff --check

@alt-glitch alt-glitch added type/bug Something isn't working P3 Low — cosmetic, nice to have comp/cli CLI entry point, hermes_cli/, setup wizard comp/plugins Plugin system and bundled plugins tool/vision Vision analysis and image generation provider/openrouter OpenRouter aggregator labels Aug 3, 2026
@teknium1

Copy link
Copy Markdown
Contributor

Thanks @zhuermu — this fix is now on main via #89841. Your commit was cherry-picked with authorship preserved (dbd3cd6, fix(image-gen): handle stale OpenRouter model defaults), so full credit stays with you in the history.

On top of your fix we widened the same unindexable-key guard to the two sibling picker sites (_configure_imagegen_model and _configure_videogen_model_for_plugin) that carried the same latent crash shape.

Closing this PR since the work has landed. Much appreciated!

@teknium1 teknium1 closed this Aug 19, 2026
Icarus-B4 pushed a commit to Icarus-B4/hermes-agent that referenced this pull request Aug 19, 2026
… video pickers

Same bug class as the plugin image picker crash (NousResearch#77238): an unguarded
`current_model = default_model` fallback that can index the catalog with a
key it doesn't contain when the provider's default drifts from its catalog.
Applies the `default if default in catalog else next(iter(catalog))` guard
to _configure_imagegen_model and _configure_videogen_model_for_plugin.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/cli CLI entry point, hermes_cli/, setup wizard comp/plugins Plugin system and bundled plugins P3 Low — cosmetic, nice to have provider/openrouter OpenRouter aggregator 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