Files
langgraph/libs/cli/langgraph_cli
Sreekara Yachamaneni 9b0d8857cc feat(cli): deploy to BYOC data planes with only an API key (#9692)
Linear: https://linear.app/langchain/issue/LSD-2184

`langgraph deploy` and its `list`, `revisions`, `logs`, and `delete`
subcommands only knew the SaaS control plane. On a BYOC data plane (AWS,
Azure, or GCP), users needed `--host-url`, got a raw 400 (`'source' must
be ...`) on CLI builds, defaulted to `serverless` even where scale to
zero isn't available, and got dashboard links pointing at the data
plane. This PR makes them work with only a LangSmith API key.

**Workspace discovery**
- Unless `--host-url` is given, the CLI calls `GET <LangSmith
API>/api/v1/workspaces` (root from `LANGSMITH_ENDPOINT`, default
`https://api.smith.langchain.com`).
- It picks the workspace from `LANGSMITH_TENANT_ID`, else the only
non-deleted workspace, else the `data_plane_url` all workspaces share.
When the key's workspaces sit on different planes and no tenant is set,
it keeps today's control-plane target, so the existing 403 workspace
prompt still applies. A `LANGSMITH_TENANT_ID` that none of the key's
workspaces match is an error that names it.
- With a `data_plane_url`, a `DataPlaneClient` sends host API calls to
`<dp>/api-host` with that workspace as `X-Tenant-ID`. Status links and
the "not enabled" message point at the LangSmith UI (regional
`smith.langchain.com`, or the self-hosted root), never the data plane.
- Without a `data_plane_url`, or when discovery fails, behavior is
unchanged: SaaS pays one extra call, and no tenant header is added.
- `--host-url` / `LANGGRAPH_HOST_URL` still overrides everything and
skips discovery.

**Data plane capabilities (`<dp>/api/v1/info` `instance_flags`; a
missing flag is false)**
- Local builds and `--remote` need `deployments_cli_builds_supported`.
Without it the CLI fails before any lookup or create, pointing at
`--push-to <registry>/<repository>` and `--image-uri`. External images
keep working and never read `/info`.
- `--agent-server-type` now defaults to `serverless` on SaaS and on data
planes with scale to zero, and to `dev` otherwise. An explicit
`serverless` or `dedicated`/`prod` the data plane doesn't support is a
usage error.
- Create bodies on a data plane are sized by `resource_spec`: `{}` for
serverless and dev, `null` for dedicated, and `deployment_type` is
`dev_zero`, omitted, or `prod`. SaaS keeps today's body.

**Older data planes**
- A 400 whose detail starts with `'source' must be` gets the same
`--push-to` / `--image-uri` hint, following the existing AWS
scale-to-zero hint.

**Unchanged and verified**
- Registry login still uses the returned `username` and `repository_url`
(falling back to `oauth2accesstoken`), which covers ECR, ACR, and
Artifact Registry `<repo>/<service>` responses.
- Upload headers from the backend are forwarded; S3 (`Content-Type`
only) and Azure (`x-ms-blob-type`) are covered by tests.
- `logs --type build` and revision polling call `list_revisions` /
`get_build_logs` on the same client, so they carry the discovered
workspace.

`_request` moved to a small shared base so the LangSmith API client
reuses the host backend's error handling. Unit tests now stub discovery
by default so none of them reach the network.

The JS CLI in langgraphjs (`libs/langgraph-cli`) has the same deploy
commands and needs a matching change.

Flag: none

## Test Plan
- [x] New unit tests for discovery selection, data-plane routing and
tenant headers, `/info` flag parsing, create bodies per type, early
refusals, the `'source' must be` hint, BYOC build logs, and BYOC
dashboard links on `*.langchain.com` data-plane hosts
- [ ] Against a real BYOC data plane on each of AWS, Azure, and GCP with
CLI builds on: `langgraph deploy` (local and `--remote`), `list`,
`revisions list`, `logs` (runtime and `--type build`), `delete`
- [ ] Against a BYOC data plane without CLI builds: local deploy fails
early with the hint; `--image-uri` deploy succeeds
2026-11-13 20:21:54 -05:00
..
2026-11-12 16:04:37 +00:00
2025-05-09 13:14:45 -07:00
2026-04-22 11:29:23 -07:00
2026-04-22 11:29:23 -07:00
2024-06-24 18:14:56 -04:00
2024-06-20 17:08:35 -04:00
2026-03-13 16:07:27 -04:00
2024-06-24 18:14:56 -04:00