mirror of
https://github.com/affaan-m/everything-claude-code.git
synced 2026-04-14 22:13:41 +08:00
fix: allow destructive bash retry after facts presented
Destructive bash gate previously denied every invocation with no isChecked call, creating an infinite deny loop. Now gates per-command on first attempt and allows retry after the model presents the required facts (targets, rollback plan, user instruction). Addresses greptile P1: "Destructive bash gate permanently blocks" Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -184,7 +184,13 @@ function run(rawInput) {
|
||||
const command = toolInput.command || '';
|
||||
|
||||
if (DESTRUCTIVE_BASH.test(command)) {
|
||||
return denyResult(destructiveBashMsg());
|
||||
// Gate destructive commands on first attempt; allow retry after facts presented
|
||||
const key = '__destructive__' + command.slice(0, 200);
|
||||
if (!isChecked(key)) {
|
||||
markChecked(key);
|
||||
return denyResult(destructiveBashMsg());
|
||||
}
|
||||
return rawInput; // allow retry after facts presented
|
||||
}
|
||||
|
||||
if (!isChecked('__bash_session__')) {
|
||||
|
||||
Reference in New Issue
Block a user