From d6c2b701b6c8c4ded5bf07aef97ce15fa3c8e5d6 Mon Sep 17 00:00:00 2001 From: Molecule AI SDK-Dev Date: Sat, 16 May 2026 20:36:12 +0000 Subject: [PATCH] fix(examples): correct stale import path in remote-agent/run.py The old path `sdk/python/` no longer exists in the standalone molecule-sdk-python repo. Update the local-dev import path to add the repo root to sys.path, which correctly resolves molecule_agent when running the script from a repo checkout. Also update the Usage section to use the correct relative path (`examples/remote-agent/run.py` instead of `python3 run.py`) and update the "What it doesn't do" docstring to reflect that Phase 30.8b (inbound A2A) is now shipped. Co-Authored-By: Claude Opus 4.7 --- examples/remote-agent/run.py | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/examples/remote-agent/run.py b/examples/remote-agent/run.py index 3c79fd5..d6e89ae 100644 --- a/examples/remote-agent/run.py +++ b/examples/remote-agent/run.py @@ -8,9 +8,11 @@ What this does: 3. Runs a heartbeat + state-poll loop; exits cleanly when the platform reports the workspace paused or deleted. -What it doesn't do (future 30.8b work): -- Host an inbound A2A server. Platform-initiated calls to this agent - won't reach it unless you expose one yourself. +What it doesn't do (see run_agent_loop for the full version): +- Host an inbound A2A server. Use run_agent_loop(handler) instead of + run_heartbeat_loop() to also receive inbound A2A messages and reply + via the platform's /notify (canvas user) and /a2a (peer agent) endpoints. + The reply transport is auto-selected based on message source. Usage: # One-time setup on the platform side: @@ -26,7 +28,7 @@ Usage: -d '{"key":"REMOTE_DEMO_KEY","value":"hello-from-remote"}' # Now run this script from any machine that can reach the platform: - WORKSPACE_ID= PLATFORM_URL=http://localhost:8080 python3 run.py + WORKSPACE_ID= PLATFORM_URL=http://localhost:8080 python3 examples/remote-agent/run.py Environment variables: WORKSPACE_ID (required) @@ -41,12 +43,14 @@ 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/ -# to sys.path so you can run `python3 run.py` without a pip install. +# resolves normally; when running from the repo checkout we add the repo root +# to sys.path so you can run `python3 examples/remote-agent/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, "..", "..")) +_molecule_agent = os.path.join(_repo_root, "molecule_agent") +if os.path.isdir(_molecule_agent) and _repo_root not in sys.path: + sys.path.insert(0, _repo_root) from molecule_agent import RemoteAgentClient # noqa: E402 -- 2.52.0