From f8a2991797dd0b8b39b30169e1ba081fee8ea017 Mon Sep 17 00:00:00 2001 From: Molecule AI SDK-Dev Date: Fri, 15 May 2026 10:02:22 +0000 Subject: [PATCH] fix(examples): correct repo-root import path in remote-agent/run.py The local-dev import path was adding sdk/python/ to sys.path, but the molecule_agent package lives at the repo root, not under sdk/python/. The dead-code path silently failed (isdir check returned False) so the script only worked when molecule-ai-sdk was pip-installed. Now uses os.path.normpath(.. / ..) pointing to the repo root instead. Co-Authored-By: Claude Opus 4.7 --- examples/remote-agent/run.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/examples/remote-agent/run.py b/examples/remote-agent/run.py index 3c79fd5..e2b5783 100644 --- a/examples/remote-agent/run.py +++ b/examples/remote-agent/run.py @@ -41,12 +41,12 @@ import os import sys # Local-dev import path — when installed via pip the molecule_agent package -# resolves normally; when running from the repo checkout we add sdk/python/ +# resolves normally; when running from the repo checkout we add the repo root # to sys.path so you can run `python3 run.py` without a pip install. _here = os.path.dirname(os.path.abspath(__file__)) -_sdk = os.path.join(_here, "..", "..", "sdk", "python") -if os.path.isdir(_sdk) and _sdk not in sys.path: - sys.path.insert(0, _sdk) +_repo_root = os.path.normpath(os.path.join(_here, "..", "..")) +if _repo_root not in sys.path: + sys.path.insert(0, _repo_root) from molecule_agent import RemoteAgentClient # noqa: E402 -- 2.52.0