From 4c71f653130c137b5f10d58ad33fefecd630755d Mon Sep 17 00:00:00 2001 From: jared Date: Fri, 17 Jul 2026 08:32:44 -0400 Subject: [PATCH] refresh-plugins: diff newest cache version dir, not first glob hit Old version directories linger in the plugin cache after upgrades, and verify_cache diffed an arbitrary (typically oldest) one against source, reporting freshly refreshed plugins as STALE. Co-Authored-By: Claude Fable 5 Claude-Session: https://claude.ai/code/session_01XaCiJr2hkuRnJZv2eJmoWt --- bin/refresh-plugins | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bin/refresh-plugins b/bin/refresh-plugins index 4fd9da1..896ba09 100755 --- a/bin/refresh-plugins +++ b/bin/refresh-plugins @@ -93,11 +93,11 @@ class PluginRefresher cache_base = File.expand_path("~/.claude/plugins/cache/#{marketplace_name}/#{plugin_name}") source_full = File.join(source_path, plugin_name) - # Find the version directory in cache + # Old version directories linger after upgrades; diff the newest one versions = Dir.glob(File.join(cache_base, '*')).select { |p| File.directory?(p) } return false if versions.empty? - cache_path = versions.first + cache_path = versions.max_by { |p| File.mtime(p) } # Run diff check (exclude plugin manager state files) output = `diff -rq "#{cache_path}" "#{source_full}" --exclude='.git' --exclude='__pycache__' --exclude='.orphaned_at' 2>&1`