feat: add ask_permission config option to ExecConfig (default: true)
This commit is contained in:
parent
4c74b13c6d
commit
8feb6892af
3 changed files with 23 additions and 5 deletions
|
|
@ -767,6 +767,7 @@ type ExecConfig struct {
|
||||||
CustomDenyPatterns []string `json:"custom_deny_patterns" env:"PICOCLAW_TOOLS_EXEC_CUSTOM_DENY_PATTERNS"`
|
CustomDenyPatterns []string `json:"custom_deny_patterns" env:"PICOCLAW_TOOLS_EXEC_CUSTOM_DENY_PATTERNS"`
|
||||||
CustomAllowPatterns []string `json:"custom_allow_patterns" env:"PICOCLAW_TOOLS_EXEC_CUSTOM_ALLOW_PATTERNS"`
|
CustomAllowPatterns []string `json:"custom_allow_patterns" env:"PICOCLAW_TOOLS_EXEC_CUSTOM_ALLOW_PATTERNS"`
|
||||||
TimeoutSeconds int `json:"timeout_seconds" env:"PICOCLAW_TOOLS_EXEC_TIMEOUT_SECONDS"` // 0 means use default (60s)
|
TimeoutSeconds int `json:"timeout_seconds" env:"PICOCLAW_TOOLS_EXEC_TIMEOUT_SECONDS"` // 0 means use default (60s)
|
||||||
|
AskPermission bool `json:"ask_permission"` // NEW
|
||||||
}
|
}
|
||||||
|
|
||||||
type SkillsToolsConfig struct {
|
type SkillsToolsConfig struct {
|
||||||
|
|
|
||||||
|
|
@ -2432,3 +2432,19 @@ func testChannelsConfigWithTokens() ChannelsConfig {
|
||||||
}
|
}
|
||||||
return channels
|
return channels
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func TestToolsConfig_IsToolEnabled_ExecAskPermission(t *testing.T) {
|
||||||
|
cfg := &ToolsConfig{
|
||||||
|
Exec: ExecConfig{
|
||||||
|
ToolConfig: ToolConfig{
|
||||||
|
Enabled: true,
|
||||||
|
},
|
||||||
|
AskPermission: true,
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
// Verify AskPermission field exists and is accessible
|
||||||
|
if !cfg.Exec.AskPermission {
|
||||||
|
t.Error("Expected AskPermission to be true")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -369,6 +369,7 @@ func DefaultConfig() *Config {
|
||||||
EnableDenyPatterns: true,
|
EnableDenyPatterns: true,
|
||||||
AllowRemote: true,
|
AllowRemote: true,
|
||||||
TimeoutSeconds: 60,
|
TimeoutSeconds: 60,
|
||||||
|
AskPermission: true, // NEW: enable permission prompts by default
|
||||||
},
|
},
|
||||||
Skills: SkillsToolsConfig{
|
Skills: SkillsToolsConfig{
|
||||||
ToolConfig: ToolConfig{
|
ToolConfig: ToolConfig{
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue