@@ -32,8 +32,8 @@ func getSessionID(ctx context.Context) (string, bool) {
3232// and edit_file to use the ACP connection for file operations
3333type FilesystemToolset struct {
3434 * builtin.FilesystemTool
35- agent * Agent
36- workindgDir string
35+ agent * Agent
36+ workingDir string
3737}
3838
3939var _ tools.ToolSet = (* FilesystemToolset )(nil )
@@ -43,7 +43,7 @@ func NewFilesystemToolset(agent *Agent, workingDir string, opts ...builtin.FileS
4343 return & FilesystemToolset {
4444 FilesystemTool : builtin .NewFilesystemTool (workingDir , opts ... ),
4545 agent : agent ,
46- workindgDir : workingDir ,
46+ workingDir : workingDir ,
4747 }
4848}
4949
@@ -81,7 +81,7 @@ func (t *FilesystemToolset) handleReadFile(ctx context.Context, toolCall tools.T
8181
8282 resp , err := t .agent .conn .ReadTextFile (ctx , acp.ReadTextFileRequest {
8383 SessionId : acp .SessionId (sessionID ),
84- Path : filepath .Join (t .workindgDir , args .Path ),
84+ Path : filepath .Join (t .workingDir , args .Path ),
8585 })
8686 if err != nil {
8787 return tools .ResultError (fmt .Sprintf ("Error reading file: %s" , err )), nil
@@ -103,7 +103,7 @@ func (t *FilesystemToolset) handleWriteFile(ctx context.Context, toolCall tools.
103103
104104 _ , err := t .agent .conn .WriteTextFile (ctx , acp.WriteTextFileRequest {
105105 SessionId : acp .SessionId (sessionID ),
106- Path : args .Path ,
106+ Path : filepath . Join ( t . workingDir , args .Path ) ,
107107 Content : args .Content ,
108108 })
109109 if err != nil {
@@ -126,7 +126,7 @@ func (t *FilesystemToolset) handleEditFile(ctx context.Context, toolCall tools.T
126126
127127 resp , err := t .agent .conn .ReadTextFile (ctx , acp.ReadTextFileRequest {
128128 SessionId : acp .SessionId (sessionID ),
129- Path : filepath .Join (t .workindgDir , args .Path ),
129+ Path : filepath .Join (t .workingDir , args .Path ),
130130 })
131131 if err != nil {
132132 return tools .ResultError (fmt .Sprintf ("Error reading file: %s" , err )), nil
@@ -143,7 +143,7 @@ func (t *FilesystemToolset) handleEditFile(ctx context.Context, toolCall tools.T
143143
144144 _ , err = t .agent .conn .WriteTextFile (ctx , acp.WriteTextFileRequest {
145145 SessionId : acp .SessionId (sessionID ),
146- Path : filepath .Join (t .workindgDir , args .Path ),
146+ Path : filepath .Join (t .workingDir , args .Path ),
147147 Content : modifiedContent ,
148148 })
149149 if err != nil {
0 commit comments