fix(opencode): release loaded instances before fixture deletion#513
Conversation
|
Warning Rate limit exceeded
You’ve run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThis PR adds ChangesDirectory-scoped Instance Disposal
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Code Review
This pull request introduces a disposeDirectory method to the instance runtime, store, and public API, enabling explicit disposal of specific project directories and their associated resources. This change is integrated into the test suite to ensure file locks are released before attempting to delete directories. A review comment suggests that reducing the file system removal retry count from 30 to 5 on Windows might be too aggressive and could lead to flakiness in environments with transient OS-level locks.
Summary
Adds a directory-scoped instance disposal path and uses it before export tests remove loaded session project fixture directories.
Why
The post-merge Windows advisory job still failed in
unit-windows-opencode-sessionwithEBUSYwhile deleting a git-backed temp project directory. The failure was a lifecycle contract bug in the test/runtime boundary: the directory had been loaded intoInstanceStore, so directory-scoped resources must be released before the fixture removes it.Related Issue
No issue. Follow-up to the post-merge Windows advisory failure after PR #511.
Human Review Status
Pending. A human should make the final merge decision after reviewing the final diff and verification evidence.
Review Focus
Please check that
disposeDirectoryis a no-load disposal path and cannot bootstrap or mutate missing directories just to clean them up.Risk Notes
Low. This adds a production lifecycle API, but the current call site is test cleanup only. Product export behavior is unchanged.
disposeDirectoryis intentionally no-load and releases only already-loaded directories; callers must only use it once the directory is no longer needed by the active task. Windows impact is positive because loaded fixture directories are released before deletion.How To Verify
Screenshots or Recordings
Not applicable. No visible UI changes.
Checklist
dev, and my PR title and commit messages use Conventional Commits in EnglishSummary by CodeRabbit
New Features
Tests