@@ -379,7 +379,7 @@ public final class ChatService: ChatServiceType, ObservableObject {
379379    public  func  stopReceivingMessage( )  async  { 
380380        if  let  activeRequestId =  activeRequestId { 
381381            do  { 
382-                 try   await  conversationProvider? . stopReceivingMessage ( activeRequestId) 
382+                 try   await  conversationProvider? . stopReceivingMessage ( activeRequestId,  workspaceURL :   getWorkspaceURL ( ) ) 
383383            }  catch  { 
384384                print ( " Failed to cancel ongoing request with WDT:  \( activeRequestId) " ) 
385385            } 
@@ -393,7 +393,7 @@ public final class ChatService: ChatServiceType, ObservableObject {
393393        await  memory. clearHistory ( ) 
394394        if  let  activeRequestId =  activeRequestId { 
395395            do  { 
396-                 try   await  conversationProvider? . stopReceivingMessage ( activeRequestId) 
396+                 try   await  conversationProvider? . stopReceivingMessage ( activeRequestId,  workspaceURL :   getWorkspaceURL ( ) ) 
397397            }  catch  { 
398398                print ( " Failed to cancel ongoing request with WDT:  \( activeRequestId) " ) 
399399            } 
@@ -491,13 +491,20 @@ public final class ChatService: ChatServiceType, ObservableObject {
491491            try   await  send ( UUID ( ) . uuidString,  content:  templateProcessor. process ( sendingMessageImmediately) ,  skillSet:  [ ] ,  references:  [ ] ) 
492492        } 
493493    } 
494-     
494+ 
495+     public  func  getWorkspaceURL( )  ->  URL ?   { 
496+         guard  !chatTabInfo. workspacePath. isEmpty else  { 
497+             return  nil 
498+         } 
499+         return  URL ( fileURLWithPath:  chatTabInfo. workspacePath) 
500+     } 
501+ 
495502    public  func  upvote( _ id:  String ,  _ rating:  ConversationRating )  async  { 
496-         try ?   await  conversationProvider? . rateConversation ( turnId:  id,  rating:  rating) 
503+         try ?   await  conversationProvider? . rateConversation ( turnId:  id,  rating:  rating,  workspaceURL :   getWorkspaceURL ( ) ) 
497504    } 
498505
499506    public  func  downvote( _ id:  String ,  _ rating:  ConversationRating )  async  { 
500-         try ?   await  conversationProvider? . rateConversation ( turnId:  id,  rating:  rating) 
507+         try ?   await  conversationProvider? . rateConversation ( turnId:  id,  rating:  rating,  workspaceURL :   getWorkspaceURL ( ) ) 
501508    } 
502509
503510    public  func  copyCode( _ id:  String )  async  { 
@@ -725,7 +732,7 @@ public final class ChatService: ChatServiceType, ObservableObject {
725732
726733        do  { 
727734            if  let  conversationId =  conversationId { 
728-                 try   await  conversationProvider? . createTurn ( with:  conversationId,  request:  request) 
735+                 try   await  conversationProvider? . createTurn ( with:  conversationId,  request:  request,  workspaceURL :   getWorkspaceURL ( ) ) 
729736            }  else  { 
730737                var  requestWithTurns  =  request
731738
@@ -738,7 +745,7 @@ public final class ChatService: ChatServiceType, ObservableObject {
738745                    requestWithTurns. turns =  turns
739746                } 
740747
741-                 try   await  conversationProvider? . createConversation ( requestWithTurns) 
748+                 try   await  conversationProvider? . createConversation ( requestWithTurns,  workspaceURL :   getWorkspaceURL ( ) ) 
742749            } 
743750        }  catch  { 
744751            resetOngoingRequest ( ) 
0 commit comments