Mission-critical audit fixes: model cache safety, task race, and stale tests#40
Closed
christopherkarani wants to merge 1 commit intomainfrom
Closed
Mission-critical audit fixes: model cache safety, task race, and stale tests#40christopherkarani wants to merge 1 commit intomainfrom
christopherkarani wants to merge 1 commit intomainfrom
Conversation
- align DiffusionModelDownloaderTests compile guard with production feature flags - replace deprecated String(cString:) CPU brand parsing path - make schema encoding error payload Sendable-safe - repair brittle model registry/provider count tests for expanded provider catalog - fix ModelCache.clearAll() to preserve metadata for entries whose deletion fails - wire ModelManager.downloadTask(for:) backing task before returning to prevent taskNotStarted races - harden OpenAI streaming parser by skipping malformed tool call deltas with empty id/name - capture ChatSession stream config under lock for consistent snapshot semantics - add regression tests for clearAll partial-failure retention and immediate task wiring
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
Owner
Author
|
Closing — these fixes were superseded by a164c7c ("Stabilize MLX, Foundation Models, and warning cleanup") which addressed the MLX gating, stale registry tests, and Sendable warnings comprehensively. |
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.
Summary
This PR delivers the mission-critical audit fixes identified in the 2026-03-18 automation run.
Correctness and Safety Fixes
ModelCache.clearAll()so it no longer wipes in-memory metadata when disk deletion partially fails.ModelManager.downloadTask(for:)race where callers could observe.taskNotStartedbefore backing work was wired.DownloadTask.id/name.PartialToolCallprecondition crashes.stream(_:)now snapshotsconfigunder lock to keep captured state consistent.API/Test Drift + Build Hygiene
DiffusionModelDownloaderTestscompile guard with production feature flags.ProviderTypecase coverage test to include new providers.String(cString:)usage inDeviceCapabilities.GenerationSchemaencoding error payload Sendable-safe.Regression Tests Added
ModelCacheTests.testClearAllRetainsEntriesWhenDeletionFailsModelManagerRegressionTests.testDownloadTaskImmediatelyWiresUnderlyingTaskVerification
swift test --filter ModelCacheTests --filter ModelManagerRegressionTestsswift test --filter ModelIdentifierTestsswift test --filter ProtocolCompilationTestsswift testswift buildAll passing in this worktree.