feat(worktrees): restore pruned workspaces on demand - #324
Conversation
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Team Run ID: 📒 Files selected for processing (13)
Included review availability: Your plan provides up to 8 included reviews per hour; 6 remain after this review. 📝 WalkthroughWalkthroughThe change preserves recovery metadata for pruned workspace sessions. Workspace lookup is now asynchronous and restores pruned managed worktrees, including concurrent-lookup deduplication and cleanup after failed reactivation. Tool handlers await workspace restoration before operating. ChangesWorkspace recovery
Estimated code review effort: 4 (Complex) | ~45 minutes Merge Risk: ⚪ Minimal · up to Pruned workspaces retain recovery state and are restored before workspace-backed operations proceed, including cleanup when restoration cannot be reactivated. No merge-blocking risk remains. Sequence Diagram(s)sequenceDiagram
participant ToolHandler
participant WorkspaceRegistry
participant WorkspaceStore
participant GitWorktrees
ToolHandler->>WorkspaceRegistry: await getWorkspace(workspaceId)
WorkspaceRegistry->>WorkspaceStore: load pruned session
WorkspaceRegistry->>GitWorktrees: restoreManagedWorktree(session)
GitWorktrees-->>WorkspaceRegistry: restored worktree
WorkspaceRegistry->>WorkspaceStore: reactivateSession(session.id)
WorkspaceRegistry-->>ToolHandler: return workspace
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 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 |
Greptile SummaryThis change adds persisted recovery state for pruned managed worktrees and restores worktrees lazily. Two reproduced restoration failures can make a workspace request fail or leave a workspace inaccessible after an interrupted state transition. Recovery snapshot refs also remain after they are no longer needed, increasing Git storage over repeated recovery cycles. Confidence Score: 3/5Not safe to merge until concurrent and partially completed workspace restoration are made recoverable. The stale recovery-ref cleanup is a separate non-blocking maintenance concern. Two independently reproduced workspace-access failures can prevent a user from opening a pruned workspace. A third reproduced lifecycle issue retains obsolete Git snapshot data. Files Needing Attention: src/workspaces.ts needs coordinated and failure-atomic restoration; src/git-worktrees.ts and the session lifecycle need recovery-ref cleanup.
What T-Rex did
|
Summary
git stash apply --indexStack
Depends on #319.
Validation
pnpm test(126 passed, 1 skipped)pnpm buildSummary by CodeRabbit
New Features
Bug Fixes