Skip to content

Fix image_generate per-call provider/model overrides - #57293

Closed
lkz-de wants to merge 5 commits into
NousResearch:mainfrom
lkz-de:lkz/image-generate-per-call-overrides-followup
Closed

Fix image_generate per-call provider/model overrides#57293
lkz-de wants to merge 5 commits into
NousResearch:mainfrom
lkz-de:lkz/image-generate-per-call-overrides-followup

Conversation

@lkz-de

@lkz-de lkz-de commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

Summary

  • add per-call provider / model override support for image_generate and thread those overrides through the FAL path end-to-end
  • warn and fall back to the default FAL model when an explicit per-call FAL model override is unknown, instead of hard-erroring the request
  • keep MoA manual and session-scoped by blocking persisted default/main-model assignments to provider: moa
  • preserve /moa <prompt> one-shot behavior while stopping implicit or durable default switching into MoA
  • document the optional provider / model override args and preserve the image_generate response-field wording around the returned image

Why

On current origin/main, image_generate still lacks the full per-call override flow and the branch also needs follow-up policy enforcement around FAL fallback behavior and MoA persistence.

This PR lands the override support and the follow-up policy fixes together:

  • explicit FAL model overrides now survive the plugin path and degrade safely with warn + fallback when the named model is unknown
  • MoA remains available for deliberate manual interactive use, but is no longer allowed to become the persisted default/main route

What changed

Image generation / FAL

  • add the per-call provider / model override surface and thread it through image_generate
  • change _resolve_fal_model(...) so unknown explicit per-call FAL model overrides emit a warning and fall back to the default FAL model
  • forward explicit model overrides through plugins/image_gen/fal/__init__.py
  • add regression coverage for the fallback behavior and plugin-path forwarding
  • document the optional override args while preserving the correct image_generate response-field wording

MoA policy

  • reject persisted default/main-model assignments where provider == "moa"
  • make explicit interactive MoA switches session-scoped in the CLI/TUI model-picker path
  • stop treating bare preset-name input as an implicit switch into MoA defaults
  • preserve /moa <prompt> as a one-shot path by leaving that path available while preventing default-routing changes into MoA

Verification

  • pytest -q tests/hermes_cli/test_model_switch_moa_policy.py tests/hermes_cli/test_web_server_moa_policy.py tests/tui_gateway/test_goal_command.py::test_moa_bare_returns_usage tests/tui_gateway/test_goal_command.py::test_moa_arg_is_always_one_shot -o addopts=''
    • result: 6 passed
  • pytest -q tests/tools/test_image_generation.py tests/tools/test_image_generation_plugin_dispatch.py -k 'fal or override or model' -o addopts=''
    • result: 32 passed, 39 deselected
  • python3 -m py_compile cli.py hermes_cli/model_switch.py hermes_cli/web_server.py plugins/image_gen/fal/__init__.py tools/image_generation_tool.py tui_gateway/server.py tests/hermes_cli/test_model_switch_moa_policy.py tests/hermes_cli/test_web_server_moa_policy.py tests/tools/test_image_generation.py tests/tools/test_image_generation_plugin_dispatch.py
    • result: success

Notes

  • full CLI MoA collection coverage was not exercised in this environment, so verification here uses the targeted policy and gateway subsets above

@alt-glitch alt-glitch added type/feature New feature or request tool/vision Vision analysis and image generation P3 Low — cosmetic, nice to have labels Jul 2, 2026
@lkz-de
lkz-de force-pushed the lkz/image-generate-per-call-overrides-followup branch from dcda87a to 7448c29 Compare July 3, 2026 03:07
@lkz-de
lkz-de force-pushed the lkz/image-generate-per-call-overrides-followup branch 2 times, most recently from 8b50ebc to 5e1e1de Compare July 5, 2026 21:02
@lkz-de
lkz-de force-pushed the lkz/image-generate-per-call-overrides-followup branch from 5e1e1de to 4c933bd Compare July 6, 2026 14:33
@lkz-de

lkz-de commented Jul 6, 2026

Copy link
Copy Markdown
Contributor Author

Splitting this into two narrower follow-up PRs for cleaner review:

I’m closing this combined PR in favor of those two split PRs so each lane can be reviewed independently.

@lkz-de lkz-de closed this Jul 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

P3 Low — cosmetic, nice to have tool/vision Vision analysis and image generation type/feature New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants