fix: handle parallel disk space fallback and expose startup failures#303
fix: handle parallel disk space fallback and expose startup failures#303
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
WalkthroughAdds propagation and persistence of a parallel failure message through the run command and TUI, exposes it as a new Changes
Sequence Diagram(s)mermaid Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related issues
🚥 Pre-merge checks | ✅ 4✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧪 Generate unit tests (beta)
No actionable comments were generated in the recent review. 🎉 🧹 Recent nitpick comments
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 |
Codecov Report❌ Patch coverage is
❌ Your patch status has failed because the patch coverage (28.81%) is below the target coverage (50.00%). You can increase the patch coverage or adjust the target coverage. Additional details and impacted files@@ Coverage Diff @@
## main #303 +/- ##
==========================================
- Coverage 44.51% 44.48% -0.04%
==========================================
Files 96 96
Lines 30175 30283 +108
==========================================
+ Hits 13432 13470 +38
- Misses 16743 16813 +70
🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Actionable comments posted: 1
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
src/parallel/worktree-manager.ts (1)
383-446:⚠️ Potential issue | 🟠 MajorDisk‑space check should target the worktree volume, not cwd.
WhenworktreeDirsits on another filesystem, checkingcwdcan misreport free space and either block valid runs or allow failures. Consider checking the worktree path (or its parent if the directory does not exist yet).🛠️ Suggested fix
- let available = await this.getAvailableDiskSpaceFromStatFs(); + const diskCheckPath = fs.existsSync(this.config.worktreeDir) + ? this.config.worktreeDir + : path.dirname(this.config.worktreeDir); + let available = await this.getAvailableDiskSpaceFromStatFs(diskCheckPath); if (available === null || available <= 0) { - available = await this.getAvailableDiskSpaceFromDf(); + available = await this.getAvailableDiskSpaceFromDf(diskCheckPath); } - private async getAvailableDiskSpaceFromStatFs(): Promise<number | null> { + private async getAvailableDiskSpaceFromStatFs(targetPath: string): Promise<number | null> { try { - const stats = await fs.promises.statfs(this.config.cwd); + const stats = await fs.promises.statfs(targetPath); const available = Number(stats.bavail) * Number(stats.bsize); - private getAvailableDiskSpaceFromDf(): number | null { + private getAvailableDiskSpaceFromDf(targetPath: string): number | null { try { - const output = execFileSync('df', ['-k', this.config.cwd], { + const output = execFileSync('df', ['-k', targetPath], { encoding: 'utf-8', });
🤖 Fix all issues with AI agents
In `@src/commands/run.tsx`:
- Around line 1969-1973: When handling the startup-rejection fallback where
parallelState.failureMessage is set, also mark the session as failed and persist
that state so it cannot be resumed; call the session failure helper on the same
object (e.g., parallelState.markFailed(parallelState.failureMessage) or
parallelState.setFailed = true) and then persist it (e.g., await
parallelState.persist() or call the existing persist/save helper used elsewhere
in this file) after setting the failureMessage, ensuring this mirrors how
failures are recorded when the parallel:failed event is emitted and uses the
same helper functions used elsewhere in this module.
Summary
Validation
Summary by CodeRabbit
New Features
Bug Fixes