Skip to content

Heal contaminated model cache#243

Closed
malzag wants to merge 10 commits into
mainfrom
heal-contaminated-model-cache
Closed

Heal contaminated model cache#243
malzag wants to merge 10 commits into
mainfrom
heal-contaminated-model-cache

Conversation

@malzag

@malzag malzag commented Jun 6, 2026

Copy link
Copy Markdown
Collaborator

No description provided.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 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 thread paddler_cache_dir/src/cache_entry_validator.rs Outdated
Comment thread paddler_test_cluster_harness/src/agents_stream_watcher.rs Outdated
Comment thread paddler_test_cluster_harness/src/agents_stream_watcher.rs Outdated

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 5 out of 5 changed files in this pull request and generated 1 comment.

Comment thread paddler_agent/src/model_source/url.rs Outdated

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 9 out of 9 changed files in this pull request and generated 2 comments.

Comment thread paddler_agent/src/continuous_batch_scheduler/mod.rs Outdated
Comment thread paddler_agent/src/continuous_batch_scheduler/mod.rs Outdated

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 6 out of 6 changed files in this pull request and generated 1 comment.

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?;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants