Improve robustness of interrupt and exit handling - #10
Conversation
- Move KeyboardInterrupt handling inside the main loop to allow interrupting actions without exiting the program. - Catch EOFError (Ctrl+D) for a clean exit. - Add "exit" and "quit" as internal command aliases for "/bye". - Catch subprocess.TimeoutExpired in shell_tool and provide a helpful message about non-interactive commands. - Update help message to include new exit commands. - Add unit tests for shell_tool timeout handling. Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
|
👋 Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
This PR improves the robustness and user experience of the ShellMind CLI by addressing issues with hanging shell commands and program termination.
Key changes:
KeyboardInterrupt(Ctrl+C) is now caught inside the main loop. This ensures that if the AI is generating a long response or a shell command is running, the user can interrupt that specific action and return to the ShellMind prompt instead of the entire application closing.exitandquitas recognized commands to close the application, aligning with common terminal expectations.Ctrl+D(EOFError) is also now handled for a graceful exit.subprocess.TimeoutExpiredin theshell_tool. If a command (like an interactive shell) hangs for more than 15 seconds, ShellMind will now return a descriptive error message explaining that commands are run non-interactively, rather than potentially crashing or leaving the user in a stuck state.tests/test_tools.pyto verify the timeout and success logic of theshell_tool.PR created automatically by Jules for task 13928666754902735052 started by @Natuworkguy