fix(image-gen): force-refresh plugin providers in long-lived sessions - #14502
Merged
Merged
Conversation
19 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.providerpoints to a backend that isn't in the registry on first lookup, dispatch now retries once with_ensure_plugins_discovered(force=True)before surfacingprovider_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_providerretries once withforce=Truewhen 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 passedopenai-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).