fix(cli): run plugin config() hooks before reading provider config#9566
Open
kilo-code-bot[bot] wants to merge 1 commit intomainfrom
Open
fix(cli): run plugin config() hooks before reading provider config#9566kilo-code-bot[bot] wants to merge 1 commit intomainfrom
kilo-code-bot[bot] wants to merge 1 commit intomainfrom
Conversation
Move plugin.list() above cfg/ModelsDev.get() in Provider state initialization so plugin config() hooks can mutate enabled_providers, disabled_providers, and provider entries before downstream consumers read them. ModelsDev.get() already reads enabled/disabled to decide whether to inject the kilo provider, so plugins must run first for that decision to see their mutations. Fixes a flaky Windows test (plugin config enabled and disabled providers are honored) that depended on mutation-in-place reference identity between the plugin-captured cfg and the provider-captured cfg — an invariant that broke whenever Instance state was disturbed between tests.
Contributor
Author
Code Review SummaryStatus: No Issues Found | Recommendation: Merge Files Reviewed (2 files)
Reviewed by gpt-5.4-20260305 · 822,339 tokens |
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.
Summary
Move
plugin.list()abovecfg/ModelsDev.get()in the Provider state initializer so pluginconfig()hooks can mutateenabled_providers,disabled_providers, andproviderentries before any downstream consumer reads them.Before this change,
ModelsDev.get()already readenabled_providers/disabled_providersfrom config to decide whether to inject the kilo provider — but it ran before plugins had a chance to mutate config, so plugin-authored filters were silently ignored at that stage. The rest of Provider.layer only saw plugin mutations becauseconfig.get()happens to return the same cached object reference that the plugin mutated in place. That reference-identity invariant broke whenever Instance state was disturbed between tests, causing the spurious Windows failure in https://github.com/Kilo-Org/kilocode/actions/runs/24988038428/job/73166225696.Why
Fixes the flaky
plugin config enabled and disabled providers are honoredtest and removes the latent bug where plugins couldn't influence the kilo-provider injection decision insideModelsDev.get().How to test
cd packages/opencode && bun run test test/provider/provider.test.ts— theplugin configtests should pass.config()hook that setscfg.disabled_providers = ["kilo"]; confirm the kilo provider no longer appears in the provider list.