Repository navigation
Closed as not planned
Closed as not planned
Copy link
Labels
coreAnything pertaining to core functionality of the application (opencode server stuff)Anything pertaining to core functionality of the application (opencode server stuff)perfIndicates a performance issue or need for optimizationIndicates a performance issue or need for optimization
Description
Problem
Every OpenCode startup runs Npm.add() for each plugin in the config, even when packages are already installed and cached. For plugins using @latest (or bare names that resolve to @latest via resolvePluginTarget()), this triggers Arborist's full reify() path on every launch.
Measured impact: ~11-15 seconds of startup time spent in npm install for 2 plugins (opencode-claude-auth@latest + oh-my-openagent@latest).
Log evidence:
17:08:53 service=plugin name=mg loading internal plugin
17:08:57 +4118ms service=plugin path=opencode-claude-auth@latest loading plugin
17:08:57 service=npm pkg=opencode-claude-auth@latest installing package
17:08:57 service=npm pkg=oh-my-openagent@latest installing package
17:09:09 +11441ms service=bus type=* subscribing
Current Behavior
resolvePluginTarget()inplugin/shared.tsappends@latestfor bare plugin namesNpm.add()innpm/index.tsattemptsloadVirtual()(fast path) but falls through toreify()- This happens unconditionally on every startup — no TTL, staleness check, or skip mechanism
Proposed Solution
Add a TTL-based cache for @latest plugin resolution:
- On startup, check the mtime of the plugin's
package-lock.json(or a dedicated cache marker file) - If last resolved within a configurable TTL (e.g., 24 hours), use the cached version — just run
loadVirtual()withoutreify() - If stale, do the full resolution + reify
- Optionally expose a config option like
plugin_update_intervalor a CLI flag like--update-pluginsto force a fresh check
This preserves the "always latest" behavior while eliminating the 11+ second tax on every startup.
Related Issues
- Disable force dependency update while starting #8729 — Disable force dependency update while starting
- Very Slow OpenCode Loading Time #7979 — Very Slow OpenCode Loading Time
- Opencode became Insanely slow #21379 — Opencode became insanely slow
- Plugins configured with @latest never auto-update: bun registry cache + stale isOutdated check #16608 — Plugins configured with @latest never auto-update
Environment
- macOS (darwin arm64)
- OpenCode 1.4.7
- Plugins:
opencode-claude-auth@latest,oh-my-openagent@latest - Package cache:
~/.cache/opencode/packages/
Metadata
Metadata
Assignees
Labels
coreAnything pertaining to core functionality of the application (opencode server stuff)Anything pertaining to core functionality of the application (opencode server stuff)perfIndicates a performance issue or need for optimizationIndicates a performance issue or need for optimization
Activity
github-actions commentedon Apr 17, 2026
This issue doesn't fully meet our contributing guidelines.
What needs to be fixed:
[FEATURE]:and a verification checkbox confirming you've searched for existing issues.Please edit this issue to address the above within 2 hours, or it will be automatically closed.
This issue might be a duplicate of existing issues. Please check:
@latestnever auto-update (open, closely related — stale check and caching behavior)If you believe this was flagged incorrectly, please let a maintainer know.
github-actions commentedon Apr 17, 2026
This issue has been automatically closed because it was not updated to meet our contributing guidelines within the 2-hour window.
Feel free to open a new issue that follows our issue templates.