Commit Graph

1 Commits

Author SHA1 Message Date
Chiguyong 4729e20bbf feat(react): U2 PLAN_EXEC autonomy mode + dangerous-tools gate (R6-R9)
ReActEngine now accepts dangerous_tools_config + autonomy_mode. In PLAN_EXEC
autonomy mode, dangerous tools (per DangerousToolsConfig whitelist) trigger
confirmation_request BEFORE first execution; non-dangerous tools execute
directly without confirmation. _build_phase_engine injects the config and
sets autonomy_mode=True when PLAN_EXEC is engaged.

- _check_autonomy_gate: pre-execution gate (serial/parallel/text-parsed paths)
- Approved dangerous tool re-executes with _skip_dangerous_check=True
- Rejected/handler-failure → permission_denied result (exit_code=126)
- Default autonomy_mode=False → transparent no-op (backward compat)
- 19 new tests (14 autonomy gate + 5 PLAN_EXEC wiring)
2026-07-06 13:23:06 +08:00