summaryrefslogtreecommitdiffhomepage
path: root/internal/llm/tools/write.go
diff options
context:
space:
mode:
authoradamdottv <[email protected]>2025-05-12 09:44:56 -0500
committeradamdottv <[email protected]>2025-05-12 09:44:56 -0500
commitdfe5fd8d970f76af9db0a7bf9a1e6f0bc01a291c (patch)
treeebf8123a492626a31b7767b18a60594879cd70b0 /internal/llm/tools/write.go
parented9fba99c9e230094ed5d468c88f81469d60c911 (diff)
downloadopencode-dfe5fd8d970f76af9db0a7bf9a1e6f0bc01a291c.tar.gz
opencode-dfe5fd8d970f76af9db0a7bf9a1e6f0bc01a291c.zip
wip: refactoring
Diffstat (limited to 'internal/llm/tools/write.go')
-rw-r--r--internal/llm/tools/write.go3
1 files changed, 2 insertions, 1 deletions
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 {