fix shell risk gate dry-run flow for destructive git clean

This commit is contained in:
野生派Coder~
2026-02-14 01:02:41 +08:00
parent 01b56f2398
commit c58c4cf11a
3 changed files with 47 additions and 2 deletions

View File

@@ -254,7 +254,7 @@ func (t *ExecTool) applyRiskGate(command string, force bool) (string, string) {
return "Error: destructive command is disabled by policy (tools.shell.risk.allow_destructive=false).", ""
}
if t.riskCfg.RequireDryRun {
if t.riskCfg.RequireDryRun && !force {
if dryRunCmd, ok := buildDryRunCommand(command); ok {
return "Risk gate: dry-run required first. Review output, then execute intentionally with force=true.", dryRunCmd
}