Skip to content

Improve robustness of interrupt and exit handling - #10

Merged
Natuworkguy merged 1 commit into
mainfrom
fix-shellmind-exit-and-interrupt-13928666754902735052
May 6, 2026
Merged

Improve robustness of interrupt and exit handling#10
Natuworkguy merged 1 commit into
mainfrom
fix-shellmind-exit-and-interrupt-13928666754902735052

Conversation

@Natuworkguy

Copy link
Copy Markdown
Owner

This PR improves the robustness and user experience of the ShellMind CLI by addressing issues with hanging shell commands and program termination.

Key changes:

  1. Interrupt Handling: The 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.
  2. Standard Exit Commands: Added exit and quit as recognized commands to close the application, aligning with common terminal expectations. Ctrl+D (EOFError) is also now handled for a graceful exit.
  3. Shell Tool Robustness: Added explicit handling for subprocess.TimeoutExpired in the shell_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.
  4. Testing: Introduced new tests in tests/test_tools.py to verify the timeout and success logic of the shell_tool.

PR created automatically by Jules for task 13928666754902735052 started by @Natuworkguy

- 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>
@google-labs-jules

Copy link
Copy Markdown

👋 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 @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

@Natuworkguy
Natuworkguy marked this pull request as ready for review May 6, 2026 16:37
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, you can upgrade your account or add credits to your account and enable them for code reviews in your settings.

@Natuworkguy
Natuworkguy merged commit 1366f8f into main May 6, 2026
13 checks passed
@Natuworkguy
Natuworkguy deleted the fix-shellmind-exit-and-interrupt-13928666754902735052 branch May 6, 2026 16:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant