Repository navigation
feat(core): reload discovered plugins from source edits - #39174
Merged
Merged
Conversation
This was referenced Jul 28, 2026
jinhuang712
pushed a commit
to jinhuang712/opencode
that referenced
this pull request
Sep 26, 2026
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.
What
Reload auto-discovered plugin files when their source changes under an existing Config root.
This fixes edits to
{plugin,plugins}/*.{ts,js}being observed by the filesystem watcher but suppressed by Config's unchangedConfig.Entry[]equality check.Before / After
Before
.opencode/plugin/local.ts.config.updatedis not published.PluginSupervisordoes not rescan and the old plugin generation remains active.After
config.changes().PluginSupervisoraccepts paths at or below{plugin,plugins}and coalesces the filesystem burst.plugin.updatedis published after the new generation is readable.How
packages/core/src/plugin/supervisor.tsfiltersconfig.changes()with normalized path containment under each active Config directory'spluginandpluginschildren.PluginSupervisor.flushaware of accepted startup work.packages/core/test/config/plugin.test.tsremoves the syntheticconfig.updatedpublication from the existing source-edit test and usesplugin.updatedas the read barrier.Scope
This PR deliberately does not add direct watches for configured local paths outside Config roots. That needs a separate versioned source plan coupling the Config snapshot, resolved entrypoint, watch kind, content revision, activation, and watcher commit.
The
Watcher.acquireReleaseinterruption-safety change is also deferred to a separate PR with focused acquisition, interruption, and teardown coverage.Testing
bun test --only-failures test/config/plugin.test.ts --timeout 30000— 11 passed, 0 failed.bun typecheckfrompackages/core— passed.bun turbo typecheck --concurrency=3— 32 tasks passed.Flow