From 1dace6c6a0d06374c5efafeb2171e7f60ca0b5ab Mon Sep 17 00:00:00 2001 From: Paul Payne Date: Mon, 6 Jul 2026 16:37:21 -0700 Subject: [PATCH] fix(core): project a reference's base_url on a bound requires MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit _target_url only resolved http_exposed deployments, so a `requires` with a `bind` pointing at a `manager: none` reference (an external resource) injected nothing. Return the reference's base_url, so binding an external endpoint into a consumer's env works — e.g. litellm's vllm-payne reference → VLLM_API_BASE. --- core/src/castle_core/deploy.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/core/src/castle_core/deploy.py b/core/src/castle_core/deploy.py index e35f60f..b9efcfa 100644 --- a/core/src/castle_core/deploy.py +++ b/core/src/castle_core/deploy.py @@ -516,6 +516,11 @@ def _target_url(config: CastleConfig, target_name: str) -> str | None: dep = matches[0][1] if matches else None if dep is None: return None + # A reference (manager: none) carries its URL directly — that's what a bind to + # an external resource projects into the consumer's env. + base = getattr(dep, "base_url", None) + if base: + return base expose = getattr(dep, "expose", None) http = getattr(expose, "http", None) if expose else None tport = http.internal.port if http else None