feat: enforce plan approval for multi-file modifications

The plan approval system now has enforcement at the tool execution level:
- After modifying more than 2 files, the agent MUST use plan_approval
- File-modifying tools (write, edit, delete, etc.) are blocked until
  an approved plan exists
- Clear error message guides agent to create and submit a plan

This ensures agents can't bypass plan approval instructions.
This commit is contained in:
2026-02-05 19:00:19 -05:00
parent 80fd7b2de3
commit 8ae1218627
2 changed files with 55 additions and 0 deletions

View File

@@ -19,6 +19,8 @@ export interface AgentOptions {
autoApprove?: boolean;
/** Chat mode - only read-only tools, no file modifications */
chatMode?: boolean;
/** Enforce plan approval for multi-file modifications (default: true) */
enforcePlanApproval?: boolean;
/** Model-specific parameters from tier detection */
modelParams?: {
temperature?: number;