Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
5ef0451
feat: add /toggle_yolo command to enable/disable YOLO mode for auto-a…
lewistransts Oct 4, 2025
a868a34
refactor(command_processor.py): simplify _handle_toggle_yolo_command …
lewistransts Oct 4, 2025
606daeb
refactor(command_processor.py): remove /toggle_yolo command and its h…
lewistransts Oct 4, 2025
30dc918
feat(handler.py): add session-based override for yolo_mode to prevent…
lewistransts Oct 4, 2025
0776494
Merge branch 'main' into feat/toggle-yolo-command
lewistransts Oct 8, 2025
04b1a8d
Merge branch 'main' into feat/toggle-yolo-command
lewistransts Oct 11, 2025
b6d6a30
feat(handler.py): simplify yolo_mode_session_override check to use bo…
lewistransts Oct 11, 2025
28c64ae
refactor(command_handlers.py): simplify the toggle logic for YOLO mod…
lewistransts Oct 11, 2025
bc8ef55
refactor(chat): remove redundant yolo_mode session override logic and…
lewistransts Oct 11, 2025
1736562
chore(handler.py): remove unused import of ConfigManagement to clean …
lewistransts Oct 11, 2025
175a63b
fix(command_processor.py): remove unnecessary blank lines and redunda…
lewistransts Oct 11, 2025
e162b91
feat(config): add dynamic configuration for yolo_mode in MessageHandl…
lewistransts Oct 15, 2025
ccca062
style(tool_manager.py): update comment for yolo_mode initialization t…
lewistransts Oct 15, 2025
012cc9b
feat(handler.py): introduce session_overrided_yolo_mode to manage YOL…
lewistransts Oct 17, 2025
f55c4fe
feat(console_ui.py): add yolo mode configuration to ConsoleUI for bet…
lewistransts Oct 17, 2025
0609674
Merge branch 'main' into feat/toggle-yolo-command
lewistransts Oct 17, 2025
75835f0
fix(handler.py): simplify yolo_mode assignment to directly set it fro…
lewistransts Oct 17, 2025
707620d
fix(handler.py): add a blank line for better readability in MessageHa…
lewistransts Oct 17, 2025
4ef931e
refactor(tool_manager): rename session_overrided_yolo_mode to enable_…
lewistransts Oct 17, 2025
64ae086
refactor(tool_manager.py): rename enable_yolo_mode_session to enable_…
lewistransts Oct 18, 2025
5d4dca1
fix(command_handlers.py): prevent enabling YOLO mode if it is already…
lewistransts Oct 18, 2025
5eca2d8
refactor(console): rename toggle_yolo command to enable_yolo for clar…
lewistransts Oct 18, 2025
7dbfb14
refactor(tool_manager.py): rename enable_session_overrided_yolo_mode …
lewistransts Oct 18, 2025
65a2ef2
chore(command_handlers.py): remove unused constant RICH_STYLE_YELLOW_…
lewistransts Oct 18, 2025
5764b6c
feat(tool_manager.py): add session-level YOLO mode override and effec…
lewistransts Oct 18, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion AgentCrew/modules/chat/message/tool_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,13 @@ def __init__(self, message_handler):
self._pending_confirmations = {} # Store futures for confirmation requests
self._next_confirmation_id = 0 # ID counter for confirmation requests
self.yolo_mode = False # Enable/disable auto-approval mode
self.session_overrided_yolo_mode: bool | None = None # Session-level override for yolo mode

def get_effective_yolo_mode(self) -> bool:
"""Determine the effective YOLO mode considering session override."""
if self.session_overrided_yolo_mode is not None:
return self.session_overrided_yolo_mode
return self.yolo_mode

def _load_persistent_auto_approved_tools(self):
"""Load persistent auto-approved tools from config."""
Expand Down Expand Up @@ -73,7 +80,7 @@ async def execute_tool(self, tool_use: Dict[str, Any]):

if (
not self.message_handler.is_non_interactive
and not self.yolo_mode
and not self.get_effective_yolo_mode()
and tool_name not in self._auto_approved_tools
):
# Request confirmation from the user
Expand Down
10 changes: 10 additions & 0 deletions AgentCrew/modules/console/command_handlers.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,16 @@ def handle_edit_config_command(self) -> None:
config_mgmt = ConfigManagement()
config_mgmt.reload_agents_from_config()

def handle_toggle_session_yolo_command(self) -> None:
"""
Toggle session-level YOLO mode override for auto-approval of tool calls.
"""
new_status = not self.message_handler.tool_manager.get_effective_yolo_mode()
self.message_handler.tool_manager.session_overrided_yolo_mode = new_status

status_text = Text(f"🚀 YOLO mode is now {'enabled' if new_status else 'disabled'} for this session", style=RICH_STYLE_YELLOW)
self.console.print(status_text)

def handle_export_agent_command(
self, agent_names_str: str, output_file: str
) -> None:
Expand Down
1 change: 1 addition & 0 deletions AgentCrew/modules/console/completers.py
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,7 @@ def get_command_completions(self, document):
("/help", "Show help message"),
("/retry", "Retry the last assistant response"),
("/toggle_transfer", "Toggle agent transfer enforcement on/off"),
("/toggle_session_yolo", "Toggle Auto-Approve Mode for Tool Calls (this session only)"),
("/exit", "Exit the application"),
("/quit", "Exit the application"),
]
Expand Down
12 changes: 12 additions & 0 deletions AgentCrew/modules/console/console_ui.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
import AgentCrew
from AgentCrew.modules.chat.message_handler import MessageHandler, Observer
from AgentCrew.modules import logger
from AgentCrew.modules.config import ConfigManagement
from .utils import agent_evaluation_remove

from .constants import (
Expand Down Expand Up @@ -73,6 +74,12 @@ def __init__(self, message_handler: MessageHandler):
)
self.command_handlers = CommandHandlers(self.console, self.message_handler)

config_manager = ConfigManagement()
global_config = config_manager.read_global_config_data()
yolo_mode_config = global_config.get("global_settings", {}).get("yolo_mode", False)
self.message_handler.tool_manager.yolo_mode = yolo_mode_config
self.message_handler.tool_manager.session_overrided_yolo_mode = yolo_mode_config

def listen(self, event: str, data: Any = None):
"""
Update method required by the Observer interface. Handles events from the MessageHandler.
Expand Down Expand Up @@ -420,6 +427,11 @@ def start(self):
self.print_welcome_message()
continue

# Handle toggle_session_yolo command directly (console only, session-based)
elif user_input.strip() == "/toggle_session_yolo":
self.command_handlers.handle_toggle_session_yolo_command()
continue

elif user_input.strip().startswith("/export_agent "):
# Extract arguments after "/export_agent "
args = user_input.strip()[14:].strip()
Expand Down
4 changes: 4 additions & 0 deletions AgentCrew/modules/console/display_handlers.py
Original file line number Diff line number Diff line change
Expand Up @@ -312,6 +312,10 @@ def print_welcome_message(self, version: str):
"Use '/toggle_transfer' to toggle agent transfer enforcement.",
style=RICH_STYLE_YELLOW,
),
Text(
"Use '/toggle_session_yolo' to toggle YOLO mode (auto-approval of tool calls) in this session only.",
style=RICH_STYLE_YELLOW,
),
Text("Use '/list' to list saved conversations.", style=RICH_STYLE_YELLOW),
Text(
"Use '/load <id>' or '/load <number>' to load a conversation.",
Expand Down
5 changes: 5 additions & 0 deletions AgentCrew/modules/console/input_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -305,6 +305,11 @@ def get_user_input(self):
)
self.clear_buffer()

# Display YOLO mode indicator if enabled
if self.message_handler.tool_manager.get_effective_yolo_mode():
yolo_indicator = Text("🔥 YOLO MODE ENABLED 🔥", style=RICH_STYLE_YELLOW_BOLD)
self.console.print(yolo_indicator)

# Wait for input while allowing events to be processed
while True:
try:
Expand Down