Skip to content

feat(core): refresh unpinned plugins on startup - #45118

Merged
kitlangton merged 3 commits into
v2from
plugin-updates
Aug 26, 2026
Merged

kitlangton merged 3 commits into
v2from
plugin-updates

Conversation

@kitlangton

@kitlangton kitlangton commented Aug 26, 2026 •

Copy link
Copy Markdown
Contributor

Why

Unpinned npm and Git plugins can advance while OpenCode continues loading an indefinitely cached installation. Refreshing on every config or location reload would introduce repeated network work and could change a plugin during a running server process.

What Changes

Plugin source First package load in a server runtime Later loads in the same runtime
Bare npm names, tags, and ranges Refresh from the registry Reuse the first result
Git branches, tags, and semver selectors Refresh the remote revision Reuse the first result
Exact npm versions Reuse the pinned installation Reuse the pinned installation
Full 40- or 64-character Git commits Reuse the pinned installation Reuse the pinned installation

If a refresh fails and a cached installation exists, OpenCode logs a warning and loads that cached plugin instead of failing startup.

Runtime Boundary

The process-global npm service records each mutable package specification after its first refresh attempt. Plugin supervisor loads opt into this behavior, so the first load of each project-local plugin acts as startup for that plugin without requiring a server-wide config scan.

Scope

This is the startup-refresh MVP only. It adds no manual update API, protocol/schema/server/client/OpenAPI surface, or plugin-management UI.

Verification

# packages/util
bun run test
bun typecheck

# packages/core
bun run test test/npm.test.ts test/config/plugin.test.ts test/plugin.test.ts
bun typecheck

# packages/www
bun typecheck
bun run check:generated
bun run build

# repository pre-push hook
bun turbo typecheck --concurrency=3

The real local Git fixture verifies mutable branch refresh across service instances, no mid-runtime refresh, exact-commit pinning, and cached fallback when the remote becomes unavailable. All listed tests, package checks, the documentation build, and the 38-package pre-push typecheck pass.

Base automatically changed from git-plugins to v2 August 26, 2026 02:02
@kitlangton kitlangton changed the title feat(core): support explicit plugin updates feat(core): refresh unpinned plugins on startup Aug 26, 2026
@kitlangton
kitlangton merged commit 695c043 into v2 Aug 26, 2026
8 checks passed
@kitlangton
kitlangton deleted the plugin-updates branch August 26, 2026 02:32
jinhuang712 pushed a commit to jinhuang712/opencode that referenced this pull request Sep 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant