(fn: () => T)
| 639 | // takes precedence over worktree isolation path. |
| 640 | const cwdOverridePath = cwd ?? worktreeInfo?.worktreePath; |
| 641 | const wrapWithCwd = <T,>(fn: () => T): T => cwdOverridePath ? runWithCwdOverride(cwdOverridePath, fn) : fn(); |
| 642 | |
| 643 | // Helper to clean up worktree after agent completes |
| 644 | const cleanupWorktreeIfNeeded = async (): Promise<{ |
no test coverage detected