diff --git a/workspace/builtin_tools/temporal_workflow.py b/workspace/builtin_tools/temporal_workflow.py index b03ae781..9e934ca1 100644 --- a/workspace/builtin_tools/temporal_workflow.py +++ b/workspace/builtin_tools/temporal_workflow.py @@ -56,17 +56,15 @@ logger = logging.getLogger(__name__) def _platform_url() -> str: - """Return the platform URL, defaulting to host.docker.internal when running - inside a Docker container (where localhost refers to the container, not the - host). External callers can always override via the PLATFORM_URL env var. + """Return the platform URL, defaulting to host.docker.internal. - Note: both branches now use the same default — the platform API is only - reachable via host.docker.internal from within a workspace container, - regardless of how the container was started. The if/else structure is - preserved for future extensibility. + The workspace runtime always runs inside a Docker container, so + ``localhost`` refers to the container itself, not the platform host. + The platform API is only reachable via ``host.docker.internal`` from + within a workspace container, regardless of how the container was started. + The legacy non-Docker branch is removed (it would have returned + ``localhost:8080`` which is unreachable from inside the container). """ - if os.path.exists("/.dockerenv") or os.environ.get("DOCKER_VERSION"): - return os.environ.get("PLATFORM_URL", "http://host.docker.internal:8080") return os.environ.get("PLATFORM_URL", "http://host.docker.internal:8080") # ─────────────────────────────────────────────────────────────────────────────