summaryrefslogtreecommitdiffhomepage
path: root/internal/llm/tools/bash.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/bash.go
parentd7569d79c6da1437fe46343ed13810df6c8cae1f (diff)
downloadopencode-3a6a26981a8074b6ab0eaadb520db986e04799ff.tar.gz
opencode-3a6a26981a8074b6ab0eaadb520db986e04799ff.zip
init command
Diffstat (limited to 'internal/llm/tools/bash.go')
-rw-r--r--internal/llm/tools/bash.go8
1 files changed, 7 insertions, 1 deletions
diff --git a/internal/llm/tools/bash.go b/internal/llm/tools/bash.go
index 18533b761..a17506197 100644
--- a/internal/llm/tools/bash.go
+++ b/internal/llm/tools/bash.go
@@ -51,7 +51,7 @@ var safeReadOnlyCommands = []string{
"git status", "git log", "git diff", "git show", "git branch", "git tag", "git remote", "git ls-files", "git ls-remote",
"git rev-parse", "git config --get", "git config --list", "git describe", "git blame", "git grep", "git shortlog",
- "go version", "go list", "go env", "go doc", "go vet", "go fmt", "go mod", "go test", "go build", "go run", "go install", "go clean",
+ "go version", "go help", "go list", "go env", "go doc", "go vet", "go fmt", "go mod", "go test", "go build", "go run", "go install", "go clean",
}
func bashDescription() string {
@@ -261,9 +261,15 @@ func (b *bashTool) Run(ctx context.Context, call ToolCall) (ToolResponse, error)
}
}
}
+
+ sessionID, messageID := GetContextValues(ctx)
+ if sessionID == "" || messageID == "" {
+ return ToolResponse{}, fmt.Errorf("session ID and message ID are required for creating a new file")
+ }
if !isSafeReadOnly {
p := b.permissions.Request(
permission.CreatePermissionRequest{
+ SessionID: sessionID,
Path: config.WorkingDirectory(),
ToolName: BashToolName,
Action: "execute",