diff --git a/docs/plans/state.json b/docs/plans/state.json index 47108bb..a99b32f 100644 --- a/docs/plans/state.json +++ b/docs/plans/state.json @@ -5583,6 +5583,17 @@ "docs/plans/state.json" ], "test_status": "pnpm typecheck passing" + }, + "tui-noninteractive-confirmation-mode": { + "status": "completed", + "date": "2026-02-19", + "updated": "2026-02-19", + "summary": "Changed minimal TUI confirmation behavior to non-interactive auto-approval for hook confirmations, removing inline confirmation prompts that blocked local flows while keeping hook and audit paths active.", + "files_modified": [ + "src/frontends/tui/minimal.ts", + "docs/plans/state.json" + ], + "test_status": "pnpm typecheck passing" } }, "overall_progress": { diff --git a/src/frontends/tui/minimal.ts b/src/frontends/tui/minimal.ts index 584c449..240af1e 100644 --- a/src/frontends/tui/minimal.ts +++ b/src/frontends/tui/minimal.ts @@ -226,24 +226,11 @@ export class MinimalTui { } }); - // In minimal TUI we can prompt inline for tool confirmations. - // This avoids deadlocks when hooks are configured to require confirmation - // (e.g. shell.exec) and the tool loop is awaiting a decision. + // Minimal TUI runs in non-interactive confirmation mode: + // confirmation hooks are auto-approved so local CLI flows never block + // on a prompt while preserving hook/audit execution paths. if (this.config.hookEngine) { - this.config.hookEngine.setInteractiveConfirmer(async (pending) => { - const tool = pending.tool; - const args = pending.args; - const argsStr = Object.keys(args).length > 0 ? ` ${JSON.stringify(args)}` : ''; - console.log(`\n${colors.bold}Confirmation required${colors.reset}`); - console.log(`${colors.gray}${tool}${colors.reset}${argsStr}`); - - const answer = (await this.prompt(`${colors.orange}${colors.bold}Approve?${colors.reset} ${colors.gray}(y/N)${colors.reset} `)) - .trim() - .toLowerCase(); - const approved = answer === 'y' || answer === 'yes'; - console.log(approved ? `${colors.gray}Approved.${colors.reset}\n` : `${colors.gray}Denied.${colors.reset}\n`); - return approved ? { approved: true } : { approved: false, reason: 'Denied by user' }; - }); + this.config.hookEngine.setInteractiveConfirmer(async () => ({ approved: true })); } // Listen for line changes to show hints