Skip to content
2 changes: 2 additions & 0 deletions dimos/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,3 +51,5 @@

# Default timeout (seconds) for thread.join() during shutdown.
DEFAULT_THREAD_JOIN_TIMEOUT = 2.0

DEFAULT_BUILD_NATIVE = False
12 changes: 3 additions & 9 deletions dimos/core/coordination/python_worker.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
import multiprocessing
from multiprocessing.connection import Connection
import os
import signal
import sys
import threading
import traceback
Expand Down Expand Up @@ -337,12 +338,11 @@ class _WorkerState:

def _worker_entrypoint(conn: Connection, worker_id: int) -> None:
apply_library_config()
signal.signal(signal.SIGINT, signal.SIG_IGN)
state = _WorkerState(instances={}, worker_id=worker_id)

try:
_worker_loop(conn, state)
except KeyboardInterrupt:
logger.info("Worker got KeyboardInterrupt.", worker_id=worker_id)
except Exception as e:
logger.error(f"Worker process error: {e}", exc_info=True)
finally:
Expand All @@ -361,12 +361,6 @@ def _worker_entrypoint(conn: Connection, worker_id: int) -> None:
worker_id=worker_id,
module_id=module_id,
)
except KeyboardInterrupt:
logger.warning(
"KeyboardInterrupt during worker stop",
module=type(instance).__name__,
worker_id=worker_id,
)
except Exception:
logger.error("Error during worker shutdown", exc_info=True)

Expand Down Expand Up @@ -433,7 +427,7 @@ def _worker_loop(conn: Connection, state: _WorkerState) -> None:
if not conn.poll(timeout=0.1):
continue
request = conn.recv()
except (EOFError, KeyboardInterrupt):
except EOFError:
break

try:
Expand Down
2 changes: 2 additions & 0 deletions dimos/core/global_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@

from pydantic_settings import BaseSettings, SettingsConfigDict

from dimos.constants import DEFAULT_BUILD_NATIVE
from dimos.models.vl.types import VlModelName

ViewerBackend: TypeAlias = Literal["rerun", "rerun-web", "rerun-connect", "foxglove", "none"]
Expand Down Expand Up @@ -52,6 +53,7 @@ class GlobalConfig(BaseSettings):
nerf_speed: float = 1.0
planner_robot_speed: float | None = None
mcp_port: int = 9990
build_native: bool = DEFAULT_BUILD_NATIVE
dtop: bool = False
obstacle_avoidance: bool = True
detection_model: VlModelName = "moondream"
Expand Down
Loading
Loading