Skip to content

Commit 5363438

Browse files
committed
fix(debug): import debugpy lazily so workers don't require it
debug.py imported debugpy at module scope, so every Temporal worker startup (run_worker.py imports setup_debug_if_enabled) required debugpy to be installed. debugpy is a development-only tool and was only ever satisfied transitively via ipykernel; agentex-sdk 0.11.5 dropped that runtime dep, so worker startup began failing with "No module named 'debugpy'" and the temporal tutorials timed out waiting for the agent. Move the import inside the AGENTEX_DEBUG_ENABLED branch where it's actually used, so normal (non-debug) startup never needs debugpy.
1 parent 1281448 commit 5363438

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

src/agentex/lib/utils/debug.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@
66

77
import os
88

9-
import debugpy # type: ignore
10-
119
from agentex.lib.utils.logging import make_logger
1210

1311
logger = make_logger(__name__)
@@ -30,6 +28,13 @@ def setup_debug_if_enabled() -> None:
3028
Any exception from debugpy setup (will bubble up naturally)
3129
"""
3230
if os.getenv("AGENTEX_DEBUG_ENABLED") == "true":
31+
# Imported lazily: debugpy is a development-only tool, so a normal
32+
# worker startup must not require it to be installed. Importing it at
33+
# module scope forced it onto every worker (it used to be satisfied
34+
# transitively via ipykernel; that dep was dropped in agentex-sdk
35+
# 0.11.5, surfacing this as "No module named 'debugpy'").
36+
import debugpy # type: ignore
37+
3338
debug_port = int(os.getenv("AGENTEX_DEBUG_PORT", "5678"))
3439
debug_type = os.getenv("AGENTEX_DEBUG_TYPE", "worker")
3540
wait_for_attach = os.getenv("AGENTEX_DEBUG_WAIT_FOR_ATTACH", "false").lower() == "true"

0 commit comments

Comments
 (0)