Skip to content

fix(image-gen): force-refresh plugin providers in long-lived sessions - #14502

Merged
teknium1 merged 2 commits into
mainfrom
hermes/hermes-fe117d2c
Apr 23, 2026
Merged

teknium1 merged 2 commits into
mainfrom
hermes/hermes-fe117d2c

Conversation

@teknium1

Copy link
Copy Markdown
Collaborator

Salvages the non-Codex plumbing from #14281 (@wysie). The Codex provider itself was already merged separately via #14317, but the force-refresh plumbing is independently useful.

Summary

If image_gen.provider points to a backend that isn't in the registry on first lookup, dispatch now retries once with _ensure_plugins_discovered(force=True) before surfacing provider_not_registered. Handles long-lived gateway sessions where a plugin was installed (or config changed) after the manager's initial discovery.

Changes

  • hermes_cli/plugins.py: discover_and_load(force=False) / _ensure_plugins_discovered(force=False) / discover_plugins(force=False) — new opt-in force flag that clears cached state and rescans.
  • tools/image_generation_tool.py: _dispatch_to_plugin_provider retries once with force=True when the provider isn't found.
  • tests/tools/test_image_generation_plugin_dispatch.py: 3 tests — happy path, missing-provider error, force-refresh recovery.
  • scripts/release.py: add Wysie to AUTHOR_MAP (release-notes CI).

Validation

  • scripts/run_tests.sh tests/tools/test_image_generation_plugin_dispatch.py tests/hermes_cli/test_plugin_scanner_recursion.py → 18/18 passed
  • E2E: real plugin manager in temp $HERMES_HOME, config points at openai-codex, fresh manager — dispatch force-refreshes, resolves the bundled backend, calls .generate() (returns auth_required as expected in isolated env).

Closes #14281 (original PR closed by author; cherry-picked the non-Codex commit with authorship preserved).

@teknium1
teknium1 merged commit 8f50f28 into main Apr 23, 2026
11 of 12 checks passed
@teknium1
teknium1 deleted the hermes/hermes-fe117d2c branch April 23, 2026 10:01
@alt-glitch alt-glitch added type/bug Something isn't working P2 Medium — degraded but workaround exists comp/plugins Plugin system and bundled plugins 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/plugins Plugin system and bundled plugins 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.

3 participants