From dfe5fd8d970f76af9db0a7bf9a1e6f0bc01a291c Mon Sep 17 00:00:00 2001 From: adamdottv <2363879+adamdottv@users.noreply.github.com> Date: Mon, 12 May 2025 09:44:56 -0500 Subject: wip: refactoring --- internal/llm/tools/write.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'internal/llm/tools/write.go') diff --git a/internal/llm/tools/write.go b/internal/llm/tools/write.go index 617d69c29..d826b3a49 100644 --- a/internal/llm/tools/write.go +++ b/internal/llm/tools/write.go @@ -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 { -- cgit v1.2.3