From 7cbbebf313ffb18a273a476b75a26a000c89472e Mon Sep 17 00:00:00 2001 From: Paulo Date: Sun, 27 Sep 2026 20:51:21 +0200 Subject: [PATCH] Enrol harnesses in the registry, not the package init Every import of a harnesses leaf module ran the package init, which loaded all harnesses and, through providers, druks.sandbox.client. Sandbox imports harnesses leaf modules, so importing druks.workspaces or druks.sandbox.client first hit a partially initialized module. The registry is the only reader of the enrolled subclasses, so it now imports the harness modules. --- backend/druks/harnesses/__init__.py | 1 - backend/druks/harnesses/registry.py | 5 +++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/backend/druks/harnesses/__init__.py b/backend/druks/harnesses/__init__.py index 614405d9..e69de29b 100644 --- a/backend/druks/harnesses/__init__.py +++ b/backend/druks/harnesses/__init__.py @@ -1 +0,0 @@ -from . import claude, codex, opencode, pi # noqa: F401 — load harnesses so they enrol diff --git a/backend/druks/harnesses/registry.py b/backend/druks/harnesses/registry.py index 9eea6997..176b4fd0 100644 --- a/backend/druks/harnesses/registry.py +++ b/backend/druks/harnesses/registry.py @@ -1,10 +1,11 @@ +from . import claude, codex, opencode, pi # noqa: F401 — load harnesses so they enrol from .base import Harness def get_harnesses() -> tuple[type[Harness], ...]: """The registry: every ``Harness`` subclass, sorted by name for a stable - order. The harness modules are imported in this package's ``__init__`` so - the subclasses are enrolled.""" + order. The harness modules are imported above so the subclasses are + enrolled.""" return tuple(sorted(Harness.__subclasses__(), key=lambda harness: harness.name))