Repository navigation
Conversation
neriousy
marked this pull request as draft
October 7, 2026 22:27
This branch has not been deployed
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
Regression from #53775. Follow-up to #53813.
Type of change
What does this PR do?
Since #53775, startup with a connected OpenCode Console fetches the Console config (
GET /api/v2/config) twice, one after the other, before plugin activation finishes. Models,/connectand anything else behindPlugin.awaitActivationwait for both.Cause: the supervisor first activates the guarded plugins on their own, then activates the full plugin list.
Plugin.activatekeeps a running plugin only if it is in the unchanged prefix of the new list. In the full list,OpencodePlugincomes aftermodels.dev, Azure and other plugins, so the plugin from the early pass is torn down and set up again, and its initialload()fetches the Console config a second time. Each fetch took ~0.9–1.25s here.Fix: the plugin saves each successful Console config fetch with the connection key and the time it was fetched. On plugin startup only, a fetch for the same connection from the last 30s is reused instead of fetched again. The saved value is keyed by the
ManagedPolicyservice instance, so it is shared within a server process and does not leak between tests.What stays the same:
I kept the plugin order unchanged. Moving
OpencodePluginearlier would avoid the restart, but its provider transform reads catalog providers thatmodels.devregisters first.How did you verify your code works?
GET /api/integrationon a freshservewith a connected Console:reuses a just-fetched Console config when the plugin starts again: it fails without the reuse (2 requests instead of 1) and passes with it.bun typecheckinpackages/core.bun test test/plugin/ test/plugin.test.ts test/mcp.test.ts test/config/policy.test.ts: 493 pass. Some supervisor tests fail onv2too when the Azure CLI is signed in, because the Azure plugin makes real requests; I ran with an emptyAZURE_CONFIG_DIR.Screenshots / recordings
N/A
Checklist