[PR #6826] perf(bun): cache plugin versions with TTL to avoid reinstalling on every startup #12126

Open
opened 2026-02-16 18:17:03 -05:00 by yindo · 0 comments
Owner

Original Pull Request: https://github.com/anomalyco/opencode/pull/6826

State: open
Merged: No


Summary

  • Fixes slow startup (~21 seconds) caused by reinstalling plugins on every launch
  • When plugins use @latest, the cache now tracks timestamps and reuses cached versions for 24 hours
  • Reduces plugin loading time from ~21s to <1s

Problem

The cache check compared 'latest' against the resolved version (e.g., '2.12.2'), which never matched:

if (parsed.dependencies[pkg] === version) return mod  // 'latest' !== '2.12.2'

Solution

  • Added _timestamps field to track when packages were installed
  • For @latest requests, reuse cached version if installed within 24 hours
  • Still allows periodic updates while avoiding redundant reinstalls
**Original Pull Request:** https://github.com/anomalyco/opencode/pull/6826 **State:** open **Merged:** No --- ## Summary - Fixes slow startup (~21 seconds) caused by reinstalling plugins on every launch - When plugins use `@latest`, the cache now tracks timestamps and reuses cached versions for 24 hours - Reduces plugin loading time from ~21s to <1s ## Problem The cache check compared `'latest'` against the resolved version (e.g., `'2.12.2'`), which never matched: ```typescript if (parsed.dependencies[pkg] === version) return mod // 'latest' !== '2.12.2' ``` ## Solution - Added `_timestamps` field to track when packages were installed - For `@latest` requests, reuse cached version if installed within 24 hours - Still allows periodic updates while avoiding redundant reinstalls
yindo added the pull-request label 2026-02-16 18:17:03 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#12126