ianderrington / genai

Generative AI
https://www.managen.ai
MIT License
6 stars 0 forks source link

Add timeout feature to BashShell to prevent hanging #59

Closed mentatbot[bot] closed 1 month ago

mentatbot[bot] commented 1 month ago

This update introduces a timeout feature to the BashShell class to address the issue where TestPersistentShell hangs. The execute method now accepts a timeout parameter, defaulting to 10 seconds. If the command execution exceeds the specified timeout, the process is terminated gracefully.

Additionally, a new test case test_command_timeout has been added to ensure that commands which take too long are properly timed out. This test verifies that the command does not run beyond the specified timeout and that the appropriate timeout message is included in the output.

Closes #57

Thanks for using MentatBot. Give comments a :+1: or :-1: to help me improve!