fix(provider): reorder plugin initialization before config snapshot#20777
Closed
luanweslley77 wants to merge 1 commit intoanomalyco:devfrom
Closed
fix(provider): reorder plugin initialization before config snapshot#20777luanweslley77 wants to merge 1 commit intoanomalyco:devfrom
luanweslley77 wants to merge 1 commit intoanomalyco:devfrom
Conversation
Moves plugin.list() before reading configProviders to ensure the plugin config() hook runs first, so any providers registered by plugins are visible when cfg.provider is captured. Previously, configProviders was read as a stale snapshot before plugins had a chance to modify it, causing plugin-registered providers to disappear after /instance/dispose. Closes anomalyco#20026
6 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.
Issue for this PR
Closes #20026
Type of change
What does this PR do?
Plugin providers registered via
config()hook disappear from the provider list after/instance/dispose. Root cause:configProviderswas captured as a stale snapshot ofcfg.providerBEFOREplugin.list()ran and called theconfig()hook. When plugins modifiedcfg.providerto add their providers, it was already too late — the snapshot didn't include them.Fix: Move
plugin.list()to run BEFORE readingconfigProviders, ensuring the pluginconfig()hook executes first. This way, any providers registered by plugins are visible whencfg.provideris captured.New execution order:
plugins = yield* plugin.list()— plugin config() hook runs, modifies cfg.providerconfigProviders = Object.entries(cfg.provider ?? {})— now sees plugin modificationsThis is a minimal reordering fix (8 lines added, 4 removed) that preserves the existing merge priority chain while fixing the timing issue.
How did you verify your code works?
/connectin TUI — plugin providers persist after instance dispose/reloadScreenshots / recordings
N/A - no UI changes
Checklist