diff --git a/libs/cli/langgraph_cli/deploy.py b/libs/cli/langgraph_cli/deploy.py index 49535f052..7b6a82e5b 100644 --- a/libs/cli/langgraph_cli/deploy.py +++ b/libs/cli/langgraph_cli/deploy.py @@ -226,9 +226,6 @@ class RequestedPlacement: "--name." ) - def must_place(self, *, required: bool) -> bool: - return required or self.requested - def resolve(self, listeners: Sequence[Listener]) -> Placement: if not listeners: if self.requested: @@ -287,7 +284,7 @@ def _describe_listeners(listeners: Sequence[Listener]) -> str: if len(listeners) > len(shown): lines.append(f" ... and {len(listeners) - len(shown)} more") if len(listeners) == MAX_PAGE_SIZE: - lines.append(f" (the first {MAX_PAGE_SIZE} listeners are shown)") + lines.append(f" (only the first {MAX_PAGE_SIZE} listeners were read)") return "\n".join(lines) @@ -1551,7 +1548,8 @@ class CustomerRegistrySource: ) def _placement(self, ctx: DeployContext) -> Placement: - if not self.placement.must_place(required=ctx.endpoints.is_cloud): + places_on_a_listener = ctx.endpoints.is_cloud or self.placement.requested + if not places_on_a_listener: return Unplaced() placement = self.placement.resolve(_available_listeners(ctx.client)) if placement.summary: diff --git a/libs/cli/tests/unit_tests/test_deploy_helpers.py b/libs/cli/tests/unit_tests/test_deploy_helpers.py index cdca4e205..292aff97e 100644 --- a/libs/cli/tests/unit_tests/test_deploy_helpers.py +++ b/libs/cli/tests/unit_tests/test_deploy_helpers.py @@ -974,35 +974,6 @@ NO_NAMESPACE = Listener("listener-3", "broken-cluster", ()) class TestRequestedPlacement: - @pytest.mark.parametrize( - ("request_", "required", "expected"), - [ - pytest.param(RequestedPlacement(), True, True, id="cloud_must_place"), - pytest.param( - RequestedPlacement(), - False, - False, - id="self_hosted_keeps_its_bundled_operator", - ), - pytest.param( - RequestedPlacement(listener_id="listener-1"), - False, - True, - id="self_hosted_places_when_asked", - ), - pytest.param( - RequestedPlacement(k8s_namespace="agents"), - False, - True, - id="a_namespace_alone_is_still_a_request", - ), - ], - ) - def test_must_place_decides_whether_listeners_matter( - self, request_, required, expected - ): - assert request_.must_place(required=required) is expected - @pytest.mark.parametrize( ("request_", "listeners", "expected"), [