Fix RAG CLI plugin marketplace cache error#2
Merged
ItMeDiaTech merged 1 commit intomasterfrom Nov 10, 2025
Merged
Conversation
Resolves EPERM permission denied errors during marketplace cache finalization on Windows by preventing file handle locks from lifecycle hooks. Root Cause: - Lifecycle hooks imported modules that initialized PathResolver singleton - PathResolver checked marketplace cache directory and held file references - Python kept file handles open after hook completed - Windows prevented marketplace directory rename due to open handles Changes: 1. Skip marketplace during lifecycle hooks (path_resolver.py, path_utils.py) - Added CLAUDE_LIFECYCLE_HOOK environment variable check - Skip marketplace directory when variable is "true" - Prevents PathResolver from locking marketplace cache 2. Set environment variable in lifecycle config (lifecycle.json) - All hooks (post_install, pre_update, post_update) set CLAUDE_LIFECYCLE_HOOK=true - Signals to path resolution to avoid marketplace cache 3. Remove module imports from verification (installer.py) - Removed imports that triggered PathResolver initialization - Verification now only checks directory structure - Module imports verified at runtime instead of install time 4. Explicit resource cleanup (installer.py, updater.py) - Added cleanup_resources() function to both modules - Forces garbage collection to release file handles - Clears PathResolver singleton instances - Runs in finally block to ensure execution 5. Added CLAUDE_PLUGIN_ROOT support (path_resolver.py) - PathResolver now checks CLAUDE_PLUGIN_ROOT environment variable - Ensures hooks use installation directory, not marketplace cache Impact: - Marketplace installation now completes without permission errors - No warnings about "Failed to finalize marketplace cache" - All functionality preserved Files Modified: - .claude-plugin/lifecycle.json - src/rag_cli_plugin/lifecycle/installer.py - src/rag_cli_plugin/lifecycle/updater.py - src/rag_cli/core/path_resolver.py - src/rag_cli_plugin/hooks/path_utils.py - KNOWN_ISSUES.md (comprehensive documentation) Tested on: Windows path handling scenarios Platform: Primarily affects Windows (stricter file locking)
ItMeDiaTech
pushed a commit
that referenced
this pull request
Nov 11, 2025
Critical fixes for v2.0: Configuration: - Disable PostToolUse hook in hooks.json (known Claude Code framework bug) - Add "enabled": false flag and update description Code cleanup: - Remove semantic_cache_hnsw.py (imports non-existent faiss dependency) - Remove vector_store.py.faiss_backup (migration artifact) - Update semantic_cache.py docstring to reference ChromaDB Documentation: - Replace all FAISS references with ChromaDB throughout README.md - Update import examples to v2.0 structure (from rag_cli.core import X) - Improve project status messaging (remove "Sorta WORKING" language) - Fix ChromaDB debugging example in CLAUDE.md - Correct documentation links (ChromaDB docs instead of FAISS wiki) Impact: - Prevents runtime errors from missing FAISS dependency - Aligns documentation with actual implementation (ChromaDB) - Fixes PostToolUse hook configuration per KNOWN_ISSUES.md - Provides professional messaging for production v2.0.0 release Resolves issues identified in error analysis: - Issue #1: PostToolUse hook configuration mismatch - Issue #2: Missing FAISS dependency in semantic_cache_hnsw.py - Issue #3: Outdated import examples in README - Issue #4: README extensively references FAISS instead of ChromaDB - Issue #5: Leftover migration backup file - Issue #6: Unprofessional project status messaging
Merged
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.
Resolves EPERM permission denied errors during marketplace cache finalization on Windows by preventing file handle locks from lifecycle hooks.
Root Cause:
Changes:
Skip marketplace during lifecycle hooks (path_resolver.py, path_utils.py)
Set environment variable in lifecycle config (lifecycle.json)
Remove module imports from verification (installer.py)
Explicit resource cleanup (installer.py, updater.py)
Added CLAUDE_PLUGIN_ROOT support (path_resolver.py)
Impact:
Files Modified:
Tested on: Windows path handling scenarios
Platform: Primarily affects Windows (stricter file locking)