From bf2e2a42da0b0563064fcf5d3eafdea50483483f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Moura?= Date: Mon, 13 Oct 2025 19:36:19 -0700 Subject: [PATCH] fix: don't error out if there it no input() available - Specific to jupyter notebooks --- src/crewai/events/listeners/tracing/utils.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/crewai/events/listeners/tracing/utils.py b/src/crewai/events/listeners/tracing/utils.py index 7b1978912..03089994c 100644 --- a/src/crewai/events/listeners/tracing/utils.py +++ b/src/crewai/events/listeners/tracing/utils.py @@ -358,7 +358,8 @@ def prompt_user_for_trace_viewing(timeout_seconds: int = 20) -> bool: try: response = input().strip().lower() result[0] = response in ["y", "yes"] - except (EOFError, KeyboardInterrupt): + except (EOFError, KeyboardInterrupt, OSError, LookupError): + # Handle all input-related errors silently result[0] = False input_thread = threading.Thread(target=get_input, daemon=True) @@ -371,6 +372,7 @@ def prompt_user_for_trace_viewing(timeout_seconds: int = 20) -> bool: return result[0] except Exception: + # Suppress any warnings or errors and assume "no" return False