Heal contaminated model cache#243
Closed
malzag wants to merge 10 commits into
Closed
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR improves robustness of model caching by detecting and repairing invalid cache entries (e.g., a stale directory occupying the expected cache file path) and adds a timeout safeguard to prevent agent stream waits from hanging indefinitely in tests.
Changes:
- Add cache entry validation and healing utilities in
paddler_cache_dir, and use them during URL model resolution. - Update URL model resolution to remove invalid cache entries before downloading, with new regression tests covering stale-directory recovery.
- Add a per-snapshot timeout to
AgentsStreamWatcher::until/until_agent, plus a new timeout-focused unit test.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| paddler_test_cluster_harness/src/agents_stream_watcher.rs | Adds a timeout wrapper around waiting for the next SSE snapshot and tests timeout behavior. |
| paddler_test_cluster_harness/Cargo.toml | Enables Tokio test time control (test-util) for the new paused-time timeout test. |
| paddler_cache_dir/src/lib.rs | Exposes new cache-entry validation/healing modules. |
| paddler_cache_dir/src/cached_downloaded_model.rs | Removes the old existence-based cache check in favor of the new validator usage elsewhere. |
| paddler_cache_dir/src/cache_entry_validator.rs | Introduces cache entry validity checks (currently follows symlinks). |
| paddler_cache_dir/src/cache_entry_healer.rs | Introduces removal of invalid cache entries (directory/symlink/etc.). |
| paddler_agent/src/model_source/url.rs | Integrates validation/healing into URL model resolution and adds recovery tests. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+48
to
+55
| let removal = if metadata.is_dir() { | ||
| fs::remove_dir_all(&self.path).await | ||
| } else { | ||
| fs::remove_file(&self.path).await | ||
| }; | ||
|
|
||
| removal?; | ||
| } |
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.
No description provided.