summaryrefslogtreecommitdiffhomepage
path: root/internal/llm/tools/fetch.go
diff options
context:
space:
mode:
authorKujtim Hoxha <[email protected]>2025-04-21 19:48:36 +0200
committerKujtim Hoxha <[email protected]>2025-04-21 19:53:55 +0200
commit3a6a26981a8074b6ab0eaadb520db986e04799ff (patch)
tree4fe2c022305f13775f2cab3cdd80cd808259765b /internal/llm/tools/fetch.go
parentd7569d79c6da1437fe46343ed13810df6c8cae1f (diff)
downloadopencode-3a6a26981a8074b6ab0eaadb520db986e04799ff.tar.gz
opencode-3a6a26981a8074b6ab0eaadb520db986e04799ff.zip
init command
Diffstat (limited to 'internal/llm/tools/fetch.go')
-rw-r--r--internal/llm/tools/fetch.go6
1 files changed, 6 insertions, 0 deletions
diff --git a/internal/llm/tools/fetch.go b/internal/llm/tools/fetch.go
index 827755863..47ff03e57 100644
--- a/internal/llm/tools/fetch.go
+++ b/internal/llm/tools/fetch.go
@@ -116,8 +116,14 @@ func (t *fetchTool) Run(ctx context.Context, call ToolCall) (ToolResponse, error
return NewTextErrorResponse("URL must start with http:// or https://"), nil
}
+ sessionID, messageID := GetContextValues(ctx)
+ if sessionID == "" || messageID == "" {
+ return ToolResponse{}, fmt.Errorf("session ID and message ID are required for creating a new file")
+ }
+
p := t.permissions.Request(
permission.CreatePermissionRequest{
+ SessionID: sessionID,
Path: config.WorkingDirectory(),
ToolName: FetchToolName,
Action: "fetch",