Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions pkg/acp/filesystem.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ func getSessionID(ctx context.Context) (string, bool) {
// and edit_file to use the ACP connection for file operations
type FilesystemToolset struct {
*builtin.FilesystemTool
agent *Agent
workindgDir string
agent *Agent
workingDir string
}

var _ tools.ToolSet = (*FilesystemToolset)(nil)
Expand All @@ -43,7 +43,7 @@ func NewFilesystemToolset(agent *Agent, workingDir string, opts ...builtin.FileS
return &FilesystemToolset{
FilesystemTool: builtin.NewFilesystemTool(workingDir, opts...),
agent: agent,
workindgDir: workingDir,
workingDir: workingDir,
}
}

Expand Down Expand Up @@ -81,7 +81,7 @@ func (t *FilesystemToolset) handleReadFile(ctx context.Context, toolCall tools.T

resp, err := t.agent.conn.ReadTextFile(ctx, acp.ReadTextFileRequest{
SessionId: acp.SessionId(sessionID),
Path: filepath.Join(t.workindgDir, args.Path),
Path: filepath.Join(t.workingDir, args.Path),
})
if err != nil {
return tools.ResultError(fmt.Sprintf("Error reading file: %s", err)), nil
Expand All @@ -103,7 +103,7 @@ func (t *FilesystemToolset) handleWriteFile(ctx context.Context, toolCall tools.

_, err := t.agent.conn.WriteTextFile(ctx, acp.WriteTextFileRequest{
SessionId: acp.SessionId(sessionID),
Path: args.Path,
Path: filepath.Join(t.workingDir, args.Path),
Content: args.Content,
})
if err != nil {
Expand All @@ -126,7 +126,7 @@ func (t *FilesystemToolset) handleEditFile(ctx context.Context, toolCall tools.T

resp, err := t.agent.conn.ReadTextFile(ctx, acp.ReadTextFileRequest{
SessionId: acp.SessionId(sessionID),
Path: filepath.Join(t.workindgDir, args.Path),
Path: filepath.Join(t.workingDir, args.Path),
})
if err != nil {
return tools.ResultError(fmt.Sprintf("Error reading file: %s", err)), nil
Expand All @@ -143,7 +143,7 @@ func (t *FilesystemToolset) handleEditFile(ctx context.Context, toolCall tools.T

_, err = t.agent.conn.WriteTextFile(ctx, acp.WriteTextFileRequest{
SessionId: acp.SessionId(sessionID),
Path: filepath.Join(t.workindgDir, args.Path),
Path: filepath.Join(t.workingDir, args.Path),
Content: modifiedContent,
})
if err != nil {
Expand Down