File tree Expand file tree Collapse file tree 3 files changed +10
-4
lines changed Expand file tree Collapse file tree 3 files changed +10
-4
lines changed Original file line number Diff line number Diff line change @@ -522,7 +522,10 @@ export class AIService extends EventEmitter {
522522 if ( ! workspace ) {
523523 return Err ( { type : "unknown" , raw : `Workspace ${ workspaceId } not found in config` } ) ;
524524 }
525- const workspacePath = workspace . workspacePath ;
525+
526+ // Use named workspace path (symlink) for user-facing operations
527+ // Agent commands should run in the path users see in the UI
528+ const workspacePath = this . config . getWorkspaceSymlinkPath ( metadata . projectPath , metadata . name ) ;
526529
527530 // Build system message from workspace metadata
528531 const systemMessage = await buildSystemMessage (
Original file line number Diff line number Diff line change @@ -598,7 +598,10 @@ export class IpcMain {
598598 if ( ! workspace ) {
599599 return Err ( `Workspace ${ workspaceId } not found in config` ) ;
600600 }
601- const workspacePath = workspace . workspacePath ;
601+
602+ // Use named workspace path (symlink) for user-facing operations
603+ // Users see the friendly name in the UI, so commands should run in that path
604+ const namedPath = this . config . getWorkspaceSymlinkPath ( metadata . projectPath , metadata . name ) ;
602605
603606 // Load project secrets
604607 const projectSecrets = this . config . getProjectSecrets ( metadata . projectPath ) ;
@@ -609,7 +612,7 @@ export class IpcMain {
609612 // Create bash tool with workspace's cwd and secrets
610613 // All IPC bash calls are from UI (background operations) - use truncate to avoid temp file spam
611614 const bashTool = createBashTool ( {
612- cwd : workspacePath ,
615+ cwd : namedPath ,
613616 secrets : secretsToRecord ( projectSecrets ) ,
614617 niceness : options ?. niceness ,
615618 tempDir : tempDir . path ,
Original file line number Diff line number Diff line change @@ -154,7 +154,7 @@ export function buildCoreSources(p: BuildSourcesParams): Array<() => CommandActi
154154 }
155155
156156 // Remove current workspace (rename action intentionally omitted until we add a proper modal)
157- if ( selected ) {
157+ if ( selected && selected . namedWorkspacePath ) {
158158 const workspaceDisplayName = `${ selected . projectName } /${ selected . namedWorkspacePath . split ( "/" ) . pop ( ) ?? selected . namedWorkspacePath } ` ;
159159 list . push ( {
160160 id : "ws:open-terminal-current" ,
You can’t perform that action at this time.
0 commit comments