Skip to content

fix(image-gen): persist plugin provider on reconfigure#14380

Closed
helix4u wants to merge 1 commit into
NousResearch:mainfrom
helix4u:codex/fix-image-gen-provider-reconfigure
Closed

fix(image-gen): persist plugin provider on reconfigure#14380
helix4u wants to merge 1 commit into
NousResearch:mainfrom
helix4u:codex/fix-image-gen-provider-reconfigure

Conversation

@helix4u

@helix4u helix4u commented Apr 23, 2026

Copy link
Copy Markdown
Contributor

What does this PR do?

Fixes the Image Generation reconfigure path so selecting a plugin-backed provider, like OpenAI, actually persists the selected provider in image_gen.provider and disables managed gateway routing for that tool.

The setup path already handled plugin image providers, but the reconfigure path only refreshed credentials/model prompts. That meant a user could select OpenAI and still have Hermes behave as if the managed Nous/FAL image route was active.

Related Issue

Fixes #

Type of Change

  • 🐛 Bug fix (non-breaking change that fixes an issue)
  • ✨ New feature (non-breaking change that adds functionality)
  • 🔒 Security fix
  • 📝 Documentation update
  • ✅ Tests (adding or improving test coverage)
  • ♻️ Refactor (no behavior change)
  • 🎯 New skill (bundled or hub)

Changes Made

  • Updated hermes_cli/tools_config.py so plugin-backed image generation providers share one persistence helper.
  • Made active-provider detection prefer explicit plugin image providers over the managed Nous entitlement label.
  • Made image generation reconfigure write image_gen.provider for plugin providers and clear that plugin selection when switching back to FAL.
  • Added regression coverage in tests/hermes_cli/test_image_gen_picker.py for plugin reconfigure, active-provider display, and FAL fallback selection.

How to Test

  1. Configure Image Generation to a managed/FAL route, then reconfigure Image Generation and select OpenAI.
  2. Confirm config.yaml writes image_gen.provider: openai, image_gen.use_gateway: false, and an OpenAI image model.
  3. Run scripts/run_tests.sh tests/hermes_cli/test_tools_config.py tests/hermes_cli/test_image_gen_picker.py.
  4. Run scripts/run_tests.sh -n 4 for the full suite.

Checklist

Code

  • I've read the Contributing Guide
  • My commit messages follow Conventional Commits (fix(scope):, feat(scope):, etc.)
  • I searched for existing PRs to make sure this isn't a duplicate
  • My PR contains only changes related to this fix/feature (no unrelated commits)
  • I've run pytest tests/ -q and all tests pass
  • I've added tests for my changes (required for bug fixes, strongly encouraged for features)
  • I've tested on my platform: Linux / WSL2

Documentation & Housekeeping

  • I've updated relevant documentation (README, docs/, docstrings) — or N/A
  • I've updated cli-config.yaml.example if I added/changed config keys — or N/A
  • I've updated CONTRIBUTING.md or AGENTS.md if I changed architecture or workflows — or N/A
  • I've considered cross-platform impact (Windows, macOS) per the compatibility guide — or N/A
  • I've updated tool descriptions/schemas if I changed tool behavior — or N/A

Screenshots / Logs

Targeted validation passed:

source venv/bin/activate && scripts/run_tests.sh tests/hermes_cli/test_tools_config.py tests/hermes_cli/test_image_gen_picker.py
47 passed in 1.75s

Full suite attempted with 4 workers:

source venv/bin/activate && scripts/run_tests.sh -n 4
33 failed, 14678 passed, 39 skipped, 206 warnings in 357.21s (0:05:57)

No failures were in tests/hermes_cli/test_image_gen_picker.py or tests/hermes_cli/test_tools_config.py. Full-suite failing tests reported by pytest:

tests/gateway/test_approve_deny_commands.py::TestBlockingApprovalE2E::test_blocking_approval_approve_once
tests/gateway/test_dingtalk.py::TestCardLifecycle::test_final_reply_finalizes_card
tests/gateway/test_dingtalk.py::TestCardLifecycle::test_intermediate_send_stays_streaming
tests/gateway/test_dingtalk.py::TestCardLifecycle::test_done_fires_only_when_reply_to_is_set
tests/gateway/test_dingtalk.py::TestCardLifecycle::test_edit_message_finalize_fires_done
tests/gateway/test_dingtalk.py::TestCardLifecycle::test_edit_message_finalize_false_tracks_sibling
tests/gateway/test_dingtalk.py::TestCardLifecycle::test_next_send_auto_closes_sibling_streaming_cards
tests/gateway/test_dingtalk.py::TestDingTalkAdapterAICards::test_send_uses_ai_card_if_configured
tests/gateway/test_discord_bot_filter.py::TestDiscordBotFilter::test_default_is_none
tests/agent/test_minimax_provider.py::TestMinimaxSwitchModelCredentialGuard::test_switch_to_minimax_does_not_resolve_anthropic_token
tests/gateway/test_agent_cache.py::TestAgentCacheIdleResume::test_close_vs_release_full_teardown_difference
tests/gateway/test_api_server.py::TestAdapterInit::test_default_config
tests/hermes_cli/test_backup.py::TestProfileRestoration::test_import_creates_profile_wrappers
tests/hermes_cli/test_plugin_scanner_recursion.py::TestKindField::test_unknown_kind_falls_back_to_standalone
tests/hermes_cli/test_tips.py::TestTipsCorpus::test_max_length_reasonable
tests/hermes_cli/test_provider_config_validation.py::TestNormalizeCustomProviderEntry::test_unknown_keys_logged
tests/hermes_cli/test_provider_config_validation.py::TestNormalizeCustomProviderEntry::test_camel_case_warning_logged
tests/run_agent/test_concurrent_interrupt.py::test_running_concurrent_worker_sees_is_interrupted
tests/run_agent/test_run_agent.py::TestBuildApiKwargsAnthropicMaxTokens::test_max_tokens_passed_to_anthropic
tests/run_agent/test_run_agent.py::TestBuildApiKwargsAnthropicMaxTokens::test_max_tokens_none_when_unset
tests/run_agent/test_run_agent.py::TestAnthropicImageFallback::test_build_api_kwargs_converts_multimodal_user_image_to_text
tests/run_agent/test_run_agent.py::TestAnthropicImageFallback::test_build_api_kwargs_reuses_cached_image_analysis_for_duplicate_images
tests/test_ctx_halving_fix.py::TestEphemeralMaxOutputTokens::test_ephemeral_override_is_used_on_first_call
tests/test_ctx_halving_fix.py::TestEphemeralMaxOutputTokens::test_ephemeral_override_is_consumed_after_one_call
tests/test_ctx_halving_fix.py::TestEphemeralMaxOutputTokens::test_subsequent_call_uses_self_max_tokens
tests/test_ctx_halving_fix.py::TestEphemeralMaxOutputTokens::test_no_ephemeral_uses_self_max_tokens_directly
tests/run_agent/test_flush_memories_codex.py::TestFlushMemoriesUsesAuxiliaryClient::test_flush_executes_memory_tool_calls
tests/tools/test_browser_camofox.py::TestCamofoxVisionConfig::test_camofox_vision_uses_configured_temperature_and_timeout
tests/tools/test_browser_cdp_tool.py::test_registered_in_browser_toolset
tests/tools/test_tirith_security.py::TestDiskFailureMarker::test_cosign_missing_marker_clears_when_cosign_appears
tests/tools/test_write_deny.py::TestWriteDenyExactPaths::test_hermes_env
tests/tools/test_zombie_process_cleanup.py::TestAgentCloseMethod::test_close_calls_cleanup_functions
tests/tools/test_zombie_process_cleanup.py::TestAgentCloseMethod::test_close_survives_partial_failures

@helix4u
helix4u marked this pull request as ready for review April 23, 2026 05:12
@alt-glitch alt-glitch added type/bug Something isn't working P2 Medium — degraded but workaround exists comp/cli CLI entry point, hermes_cli/, setup wizard tool/vision Vision analysis and image generation labels Apr 23, 2026
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 P2 Medium — degraded but workaround exists 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.

2 participants