wip: refactoring

This commit is contained in:
adamdottv 2025-05-12 09:44:56 -05:00
parent ed9fba99c9
commit dfe5fd8d97
No known key found for this signature in database
GPG key ID: 9CB48779AF150E75
19 changed files with 97 additions and 75 deletions

View file

@ -167,6 +167,7 @@ func (w *writeTool) Run(ctx context.Context, call ToolCall) (ToolResponse, error
permissionPath = rootDir
}
p := w.permissions.Request(
ctx,
permission.CreatePermissionRequest{
SessionID: sessionID,
Path: permissionPath,
@ -189,7 +190,7 @@ func (w *writeTool) Run(ctx context.Context, call ToolCall) (ToolResponse, error
}
// Check if file exists in history
file, err := w.files.GetByPathAndSession(ctx, filePath, sessionID)
file, err := w.files.GetLatestByPathAndSession(ctx, filePath, sessionID)
if err != nil {
_, err = w.files.Create(ctx, sessionID, filePath, oldContent)
if err != nil {