mirror of
https://github.com/sst/opencode.git
synced 2025-08-22 05:54:08 +00:00
fix: permission prompting issues (#1884)
This commit is contained in:
parent
b5d61b77f7
commit
832d8da453
4 changed files with 5 additions and 0 deletions
|
@ -82,11 +82,13 @@ export namespace Permission {
|
|||
sessionID: input.sessionID,
|
||||
messageID: input.messageID,
|
||||
toolCallID: input.callID,
|
||||
pattern: input.pattern,
|
||||
})
|
||||
if (approved[input.sessionID]?.[input.pattern ?? input.type]) return
|
||||
const info: Info = {
|
||||
id: Identifier.ascending("permission"),
|
||||
type: input.type,
|
||||
pattern: input.pattern,
|
||||
sessionID: input.sessionID,
|
||||
messageID: input.messageID,
|
||||
callID: input.callID,
|
||||
|
|
|
@ -94,6 +94,7 @@ export const BashTool = Tool.define("bash", {
|
|||
if (needsAsk) {
|
||||
await Permission.ask({
|
||||
type: "bash",
|
||||
pattern: params.command,
|
||||
sessionID: ctx.sessionID,
|
||||
messageID: ctx.messageID,
|
||||
callID: ctx.callID,
|
||||
|
|
|
@ -83,6 +83,7 @@ export const EditTool = Tool.define("edit", {
|
|||
sessionID: ctx.sessionID,
|
||||
messageID: ctx.messageID,
|
||||
callID: ctx.callID,
|
||||
pattern: filePath,
|
||||
title: "Edit this file: " + filePath,
|
||||
metadata: {
|
||||
filePath,
|
||||
|
|
|
@ -28,6 +28,7 @@ export const WebFetchTool = Tool.define("webfetch", {
|
|||
if (cfg.permission?.webfetch === "ask")
|
||||
await Permission.ask({
|
||||
type: "webfetch",
|
||||
pattern: params.url,
|
||||
sessionID: ctx.sessionID,
|
||||
messageID: ctx.messageID,
|
||||
callID: ctx.callID,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue