-
Notifications
You must be signed in to change notification settings - Fork 20
Feature: Toggle YOLO mode command #33
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
…pproval of tool calls - Add new /toggle_yolo command in CommandProcessor to toggle YOLO mode - Update global configuration when toggling YOLO mode setting - Add command to console completers and help documentation - Provide user feedback with appropriate emojis (🚀 for enabled, 🛡️ for disabled) - Update current tool manager's yolo_mode setting immediately after config change YOLO mode enables automatic approval of tool calls, bypassing user confirmation prompts.
…by removing unnecessary comments and improving readability
…andler to simplify command processing logic
… unintended changes during active sessions feat(tool_manager.py): implement methods for managing session-based yolo_mode overrides and retrieving effective mode feat(console_ui.py): add command to toggle yolo_mode for the current session, enhancing user control over tool execution
config_manager = ConfigManagement() | ||
return set(config_manager.get_auto_approval_tools()) | ||
|
||
def set_yolo_mode_session_override(self, enabled: bool): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
useless function, use property directly
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
removed
self.yolo_mode_session_override = enabled | ||
self.yolo_mode = enabled | ||
|
||
def get_effective_yolo_mode(self) -> bool: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
useless function, use property directly
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
removed
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.yolo_mode_session_override = None # Track session-based overrides |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use True/False
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
removed this property, use yolo_mode only, pls check again
|
||
|
||
except Exception as e: | ||
self.message_handler._notify( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what is this catch for?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks like it's unnecessary, removed
|
||
# Handle toggle_yolo command directly (console only, session-based) | ||
if user_input.strip() == "/toggle_yolo": | ||
try: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
move this logic to a separated private function
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
ce04b1c
to
b23d50d
Compare
…olean logic for clarity refactor(tool_manager.py): remove unnecessary methods related to yolo_mode_session_override for cleaner code feat(command_handlers.py): add handle_toggle_yolo_command method to manage YOLO mode toggling refactor(console_ui.py): delegate /toggle_yolo command handling to CommandHandlers for better organization
…e to enhance readability and maintainability
… initialize yolo_mode from config to simplify code and improve clarity fix(console): update toggle_yolo command description for better understanding of its functionality feat(console): display YOLO mode indicator in input handler when enabled to enhance user feedback
…up code and improve readability
…nt exception handling to clean up the code and improve readability
…er and ConsoleUI to allow on-the-fly updates refactor(tool_manager): remove redundant initialization of yolo_mode from ConfigManagement in ToolManager to streamline code
…o improve clarity and readability
…O mode per session fix(tool_manager.py): update condition to check both session_overrided_yolo_mode and yolo_mode for tool confirmation refactor(command_handlers.py): toggle session_overrided_yolo_mode instead of yolo_mode for better control chore(console_ui.py): remove redundant initialization of yolo_mode from global config in ConsoleUI
…ter tool management flexibility
…m global config fix(input_handler.py): update YOLO mode indicator condition to include session_overrided_yolo_mode for accurate display
…ndler class style(tool_manager.py): add comment to clarify purpose of session_overrided_yolo_mode variable
…yolo_mode_session for clarity and consistency fix(command_handlers): update reference to session_overrided_yolo_mode to enable_yolo_mode_session for correct functionality fix(console_ui): update reference to session_overrided_yolo_mode to enable_yolo_mode_session for correct configuration loading fix(input_handler): update reference to session_overrided_yolo_mode to enable_yolo_mode_session for accurate YOLO mode indication
…session_overrided_yolo_mode for clarity fix(command_handlers.py): update references to enable_yolo_mode_session to use the new name fix(console_ui.py): update references to enable_yolo_mode_session to use the new name fix(input_handler.py): update references to enable_yolo_mode_session to use the new name
… enabled in config to avoid redundant state changes
…ity and consistency across the codebase
…to session_overrided_yolo_mode for clarity and consistency refactor(command_handlers.py): update reference to session_overrided_yolo_mode to match new naming convention refactor(console_ui.py): update reference to session_overrided_yolo_mode to match new naming convention refactor(input_handler.py): update reference to session_overrided_yolo_mode to match new naming convention
…BOLD to clean up code docs(command_handlers.py): update docstring for handle_enable_yolo_command method to clarify functionality
No description provided.