diff --git a/libs/cli/langgraph_cli/config.py b/libs/cli/langgraph_cli/config.py index 32ae63ea2..3dcca9840 100644 --- a/libs/cli/langgraph_cli/config.py +++ b/libs/cli/langgraph_cli/config.py @@ -1269,6 +1269,11 @@ def docker_tag( version_distro_tag = f"{version}{distro_tag}" # Prepend API version if provided + # Strip an existing tag from base_image so we don't produce two colons + # (e.g. "langchain/langgraph-server:0.2" → "langchain/langgraph-server"). + if ":" in base_image: + base_image = base_image.rsplit(":", 1)[0] + if api_version: full_tag = f"{api_version}-{language}{version_distro_tag}" elif "/langgraph-server" in base_image and version_distro_tag not in base_image: @@ -1276,11 +1281,6 @@ def docker_tag( else: full_tag = version_distro_tag - # Strip an existing tag from base_image so we don't produce two colons - # (e.g. "langchain/langgraph-server:0.2" → "langchain/langgraph-server"). - if ":" in base_image: - base_image = base_image.rsplit(":", 1)[0] - return f"{base_image}:{full_tag}" @@ -1427,13 +1427,6 @@ def config_to_compose( additional_contexts: {executor_additional_contexts_str}""" - if not api_version: - raise click.ClickException( - "Distributed runtime requires a pinned API version for all images.\n" - "Either pass --api-version explicitly or let the CLI resolve it " - "from the Docker Hub version marker." - ) - postgres_uri = "postgres://postgres:postgres@langgraph-postgres:5432/postgres?sslmode=disable" result += f""" langgraph-orchestrator: image: langchain/langgraph-orchestrator-licensed:{api_version} diff --git a/libs/cli/tests/unit_tests/test_config.py b/libs/cli/tests/unit_tests/test_config.py index 66810f632..cf36ee6a7 100644 --- a/libs/cli/tests/unit_tests/test_config.py +++ b/libs/cli/tests/unit_tests/test_config.py @@ -1904,18 +1904,6 @@ def test_config_to_compose_distributed_orchestrator_uses_api_version(): assert "langchain/langgraph-orchestrator-licensed:0.7.67" in actual -def test_config_to_compose_distributed_requires_api_version(): - """Without api_version, distributed mode should raise ClickException.""" - graphs = {"agent": "./agent.py:graph"} - with pytest.raises(click.ClickException, match="pinned API version"): - config_to_compose( - PATH_TO_CONFIG, - validate_config({"dependencies": ["."], "graphs": graphs}), - "langchain/langgraph-api", - engine_runtime_mode="distributed", - ) - - def test_config_to_compose_distributed_all_images_same_version(): """All 3 images (api, executor, orchestrator) should use the same api_version.""" graphs = {"agent": "./agent.py:graph"}