From d60d981281719ebb9ccbe0fd3b8595a4f7f3886a Mon Sep 17 00:00:00 2001 From: Ben Barclay Date: Mon, 27 Jul 2026 16:44:27 +1000 Subject: [PATCH] fix(sync): don't require a base URL when an explicit client is supplied pull_org_skills/propose_skill resolved and demanded HERMES_SYNC_BASE_URL before using the caller-provided `client`, which already carries its own base URL. Only resolve/require it on the path that actually constructs a client. Caught by scripts/run_tests.sh, which blanks env vars to match CI. Plain `pytest` masked it: my shell had HERMES_SYNC_BASE_URL exported from live testing, so the redundant check silently passed. Reproduced deliberately with `env -u HERMES_SYNC_BASE_URL pytest` before fixing. 371 passed / 0 failed across the sync, skills, prompt, and skill-utils suites via the canonical runner. --- tools/skills_sync_client.py | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/tools/skills_sync_client.py b/tools/skills_sync_client.py index a864a15133a..daa582f8c28 100644 --- a/tools/skills_sync_client.py +++ b/tools/skills_sync_client.py @@ -1694,10 +1694,11 @@ def pull_org_skills( if "org_id" not in identity: raise SyncInertError("no organisation context available") org_id = identity["org_id"] - base_url = resolve_sync_base_url() - if not base_url: - raise SyncInertError("no sync base URL configured") - client = client or HSPClient(base_url, identity["api_key"]) + if client is None: + base_url = resolve_sync_base_url() + if not base_url: + raise SyncInertError("no sync base URL configured") + client = HSPClient(base_url, identity["api_key"]) caps = client.capabilities() _check_version(caps) @@ -1806,10 +1807,11 @@ def propose_skill( """ identity = identity or resolve_org_identity() org_id = identity["org_id"] - base_url = resolve_sync_base_url() - if not base_url: - raise SyncInertError("no sync base URL configured") - client = client or HSPClient(base_url, identity["api_key"]) + if client is None: + base_url = resolve_sync_base_url() + if not base_url: + raise SyncInertError("no sync base URL configured") + client = HSPClient(base_url, identity["api_key"]) caps = client.capabilities() _check_version(caps)