File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed
src/extension/agents/copilotcli/node Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -260,8 +260,15 @@ export class CopilotCLISession extends DisposableStore implements ICopilotCLISes
260260 // auto-approve the write request. Currently we only set non-workspace working directories when using git worktrees.
261261 const editFile = Uri . file ( permissionRequest . fileName ) ;
262262
263- if ( ! this . workspaceService . getWorkspaceFolder ( Uri . file ( workingDirectory ) ) && extUriBiasedIgnorePathCase . isEqualOrParent ( editFile , Uri . file ( workingDirectory ) ) ) {
264- this . logService . trace ( `[CopilotCLISession] Auto Approving request to write file in working directory ${ permissionRequest . fileName } ` ) ;
263+ const isWorkspaceFile = this . workspaceService . getWorkspaceFolder ( editFile ) ;
264+ const isWorkingDirectoryFile = ! this . workspaceService . getWorkspaceFolder ( Uri . file ( workingDirectory ) ) && extUriBiasedIgnorePathCase . isEqualOrParent ( editFile , Uri . file ( workingDirectory ) ) ;
265+
266+ if ( isWorkspaceFile || isWorkingDirectoryFile ) {
267+ if ( isWorkspaceFile ) {
268+ this . logService . trace ( `[CopilotCLISession] Auto Approving request to write file in workspace ${ permissionRequest . fileName } ` ) ;
269+ } else {
270+ this . logService . trace ( `[CopilotCLISession] Auto Approving request to write file in working directory ${ permissionRequest . fileName } ` ) ;
271+ }
265272 const editKey = getEditKeyForFile ( editFile ) ;
266273
267274 // If we're editing a file, start tracking the edit & wait for core to acknowledge it.
You can’t perform that action at this time.
0 commit comments