diff --git a/openhands/runtime/impl/eventstream/eventstream_runtime.py b/openhands/runtime/impl/eventstream/eventstream_runtime.py index fab0cf0244..26cdb60f1d 100644 --- a/openhands/runtime/impl/eventstream/eventstream_runtime.py +++ b/openhands/runtime/impl/eventstream/eventstream_runtime.py @@ -111,6 +111,9 @@ class LogBuffer: def close(self, timeout: float = 5.0): self._stop_event.set() self.log_stream_thread.join(timeout) + # Close the log generator to release the file descriptor + if hasattr(self.log_generator, 'close'): + self.log_generator.close() class EventStreamRuntime(Runtime):