-
Notifications
You must be signed in to change notification settings - Fork 99
refactor: MCP LIFO converted cache #3280
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR refactors the MCP LIFO converted cache system with significant enhancements across four phases. The changes introduce UUID-based file naming for collision prevention, file-based locking for concurrent conversion safety, enhanced change detection using multiple signals (hash, inode, size, mtime), cache format migration from v0 to v1, and comprehensive metrics tracking.
Key Changes:
- UUID-based unique file naming to prevent conversion collisions
- File-based locking mechanism (ConversionLock class) to prevent race conditions during concurrent conversions
- Enhanced change detection with multi-factor signals (hash, inode, size, mtime) and cache format versioning
- Metrics tracking for conversions, cache performance, cleanup operations, and errors
- Robust error handling with partial conversion cleanup and cache corruption recovery
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 13 comments.
| File | Description |
|---|---|
| .claude/skills/src/mcp-tools.ts | Implements UUID-based converted file naming, pattern-based search for existing conversions, enhanced error handling with partial file cleanup on conversion failure |
| .claude/skills/src/converted-file-manager.ts | Major refactor introducing ConversionLock class, cache format versioning (v0→v1), enhanced change detection, secure file permissions, metrics tracking, and comprehensive error recovery mechanisms |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 2 out of 2 changed files in this pull request and generated 16 comments.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 2 out of 2 changed files in this pull request and generated 13 comments.
.claude/skills/src/mcp-tools.ts
Outdated
|
|
||
| // Generate unique converted file path with UUID to prevent collisions | ||
| const { randomUUID } = await import('crypto'); | ||
| const uuid = randomUUID().substring(0, 8); // Use first 8 chars for readability |
Copilot
AI
Jan 5, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using only the first 8 characters of a UUID (line 365) significantly reduces collision resistance. A full UUID has 122 bits of randomness, but 8 hex characters provide only 32 bits, meaning a 50% collision probability after roughly 65,000 conversions (birthday paradox). For a production system handling many conversions, consider using at least 16 characters (64 bits) or the full UUID to ensure adequate collision resistance.
| const uuid = randomUUID().substring(0, 8); // Use first 8 chars for readability | |
| const uuid = randomUUID(); |
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 2 out of 2 changed files in this pull request and generated 9 comments.
No description provided.