fix(cache): sweep orphaned models tmp files on refresh - #131
Conversation
Dependency Review✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.Scanned FilesNone |
Memory benchmarkCompared base
Interpretation: No metric shows a clear Base-to-PR difference beyond its measured run-to-run variation. Extension overhead above pi baseline
Values are medians of 6 alternating, paired runs. The value after Environment: pi
|
karaaslanz
left a comment
There was a problem hiding this comment.
Reviewed exact head 7b5b44b. The stale-temp sweep is bounded to old cache temp files, preserves recent concurrent writes, and uses unique per-attempt temp names. Exact-head typecheck and focused model/cache regressions passed locally, and the required CI/security checks are green. Approving.
Fixes #130.
Background refresh is fire-and-forget (
void this.refresh()), so a host exiting between the temp write and the rename leaves an orphanedcommandcode-models.json.<pid>.tmpbehind with no cleanup on the next startup.This change:
Verified locally: typecheck clean, test-models 25/25 (incl. a new sweep test covering stale-removal + recent-preservation), test-runtime 11/11, test-pricing 8/8, prettier clean.