Repository navigation
fix(core): drop early guarded plugin activation - #53819
Merged
Merged
Conversation
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.
Stopgap for regressions from #53775. This removes the first-generation
registry.activate(pre.filter(guarded))step inPluginSupervisorwhile we restructure how organization policy is loaded before plugin resolution.Why
The early step activates
OpencodePluginas a separate plugin generation before the full activation. That has three side effects:/connectstay empty until the slowest server is up.OpencodePluginis set up twice.Plugin.activatekeeps only an unchanged leading prefix of running plugins.[OpencodePlugin]is never the prefix of the full list, so it is torn down and set up again, and the Console config is fetched twice.guardedincludesConfigPolicyPlugin, but the filter runs overpreand that plugin is inpost. The early batch adds Console MCP servers with nointegration.usefilter. They can start before the full activation removes them.What still works
OpencodePluginandConfigPolicyPluginare now set up in the same batch.managed.set(...)happens before MCP and provider transforms are evaluated.provider.use,tool.use, andintegration.useformcp:*, from config and org, all apply from the first reconcile.integration.useforplugin:*from config files still blocks before install or import, becausePluginModulereads config entries directly.managed.changes().Known gap
At startup, an external plugin denied by Console org policy is installed and set up once before it is unloaded. The first
resolve()runs before Console statements arrive.managed.changes()then triggers a re-activation that blocks and unloads it. Config-authored plugin denials are unaffected. The follow-up is to load org policy ahead ofresolve()without activating a plugin generation.Verification
bun test test/plugin/supervisor-reload.test.ts test/plugin/module.test.ts test/plugin/provider-opencode.test.ts test/config/policy.test.ts test/mcp.test.ts: 143 passbun typecheckinpackages/core: cleanSupersedes the startup fix in #53813 (its stale-start guard is still worth landing separately).