langgraph-api 0.19.0.dev5__py3-none-any.whl → 0.19.0.dev7__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (48) hide show
  1. langgraph_api/__init__.py +1 -1
  2. langgraph_api/api/meta.py +11 -2
  3. langgraph_api/api/runs.py +25 -6
  4. langgraph_api/api/threads.py +36 -4
  5. langgraph_api/config/__init__.py +25 -0
  6. langgraph_api/errors.py +27 -0
  7. langgraph_api/event_streaming/service.py +9 -7
  8. langgraph_api/event_streaming/session.py +18 -1
  9. langgraph_api/executor/__main__.py +18 -4
  10. langgraph_api/go_prometheus_metrics.py +52 -0
  11. langgraph_api/grpc/ops/runs.py +40 -25
  12. langgraph_api/grpc/ops/threads.py +48 -7
  13. langgraph_api/js/client.mts +17 -5
  14. langgraph_api/js/errors.py +9 -2
  15. langgraph_api/js/package.json +2 -2
  16. langgraph_api/js/remote.py +9 -1
  17. langgraph_api/js/src/utils/serde.mts +21 -0
  18. langgraph_api/js/yarn.lock +113 -113
  19. langgraph_api/metadata.py +4 -11
  20. langgraph_api/metrics_otlp.py +13 -1
  21. langgraph_api/models/run.py +1 -0
  22. langgraph_api/queue_entrypoint.py +5 -1
  23. langgraph_api/runtime/__init__.py +1 -0
  24. langgraph_api/runtime/lifespan.py +335 -0
  25. langgraph_api/runtime/metrics.py +26 -0
  26. langgraph_api/runtime/queue.py +457 -0
  27. langgraph_api/runtime/retry.py +87 -0
  28. langgraph_api/self_hosted_metrics.py +4 -1
  29. langgraph_api/serde.py +3 -1
  30. langgraph_api/stream.py +64 -5
  31. langgraph_api/utils/__init__.py +7 -3
  32. langgraph_api/validation.py +1 -0
  33. langgraph_api/web_identity.py +287 -0
  34. langgraph_api/worker.py +28 -9
  35. langgraph_api/worker_runtime.py +21 -0
  36. {langgraph_api-0.19.0.dev5.dist-info → langgraph_api-0.19.0.dev7.dist-info}/METADATA +1 -1
  37. {langgraph_api-0.19.0.dev5.dist-info → langgraph_api-0.19.0.dev7.dist-info}/RECORD +48 -41
  38. langgraph_grpc_common/proto/core_api_pb2.py +160 -158
  39. langgraph_grpc_common/proto/core_api_pb2.pyi +93 -9
  40. langgraph_grpc_common/proto/core_api_pb2_grpc.py +44 -0
  41. langgraph_grpc_common/proto/core_api_pb2_grpc.pyi +12 -0
  42. langgraph_grpc_common/proto/orchestrator_pb2.py +4 -4
  43. langgraph_grpc_common/proto/orchestrator_pb2.pyi +5 -1
  44. langgraph_runtime/__init__.py +3 -0
  45. openapi.json +43 -2
  46. {langgraph_api-0.19.0.dev5.dist-info → langgraph_api-0.19.0.dev7.dist-info}/WHEEL +0 -0
  47. {langgraph_api-0.19.0.dev5.dist-info → langgraph_api-0.19.0.dev7.dist-info}/entry_points.txt +0 -0
  48. {langgraph_api-0.19.0.dev5.dist-info → langgraph_api-0.19.0.dev7.dist-info}/licenses/LICENSE +0 -0
@@ -4,7 +4,7 @@ from __future__ import annotations
4
4
 
5
5
  import asyncio
6
6
  from contextlib import AsyncExitStack, aclosing
7
- from datetime import UTC
7
+ from datetime import UTC, datetime
8
8
  from http import HTTPStatus
9
9
  from typing import TYPE_CHECKING, Any, Literal
10
10
  from uuid import UUID
@@ -45,7 +45,7 @@ from langgraph_api.grpc.ops import (
45
45
  )
46
46
  from langgraph_api.grpc.ops.runs import Runs, forget_deleted_thread
47
47
  from langgraph_api.schema import ThreadUpdateResponse
48
- from langgraph_api.serde import json_dumpb, json_dumpb_optional, json_loads
48
+ from langgraph_api.serde import Fragment, json_dumpb, json_dumpb_optional, json_loads
49
49
  from langgraph_api.state import (
50
50
  patch_interrupt,
51
51
  read_state,
@@ -193,6 +193,17 @@ def fragment_to_value(fragment: pb.Fragment | None) -> Any:
193
193
  return None
194
194
 
195
195
 
196
+ def _fragment_passthrough(fragment: pb.Fragment) -> Fragment | None:
197
+ """The fragment's JSON, undecoded, for a response to relay as-is.
198
+
199
+ Empty values read as None, as in ``fragment_to_value``. The core encodes
200
+ values with ``json.Marshal``, so the bytes are valid JSON.
201
+ """
202
+ if not fragment.value or fragment.value == b"{}":
203
+ return None
204
+ return Fragment(fragment.value)
205
+
206
+
196
207
  def _proto_interrupts_to_dict(
197
208
  interrupts_map: dict[str, pb.Interrupts],
198
209
  ) -> dict[str, list[dict[str, Any]]]:
@@ -217,8 +228,13 @@ def _proto_interrupts_to_dict(
217
228
  return out
218
229
 
219
230
 
220
- def proto_to_thread(proto_thread: pb.Thread) -> Thread:
221
- """Convert protobuf Thread to API dictionary format."""
231
+ def proto_to_thread(proto_thread: pb.Thread, *, raw_values: bool = False) -> Thread:
232
+ """Convert protobuf Thread to API dictionary format.
233
+
234
+ With ``raw_values``, ``values`` stays the core's JSON bytes (a ``Fragment``)
235
+ instead of Python objects. Decoding a large thread's values and encoding
236
+ them again for the response costs several times their size in memory.
237
+ """
222
238
  thread_id = (
223
239
  UUID(proto_thread.thread_id.value)
224
240
  if proto_thread.HasField("thread_id")
@@ -256,7 +272,11 @@ def proto_to_thread(proto_thread: pb.Thread) -> Thread:
256
272
  "config": fragment_to_value(proto_thread.config) or {},
257
273
  "error": fragment_to_value(proto_thread.error),
258
274
  "status": status,
259
- "values": fragment_to_value(proto_thread.values),
275
+ "values": (
276
+ _fragment_passthrough(proto_thread.values)
277
+ if raw_values
278
+ else fragment_to_value(proto_thread.values)
279
+ ),
260
280
  "interrupts": _proto_interrupts_to_dict(dict(proto_thread.interrupts)),
261
281
  "run_priority": (
262
282
  proto_thread.priority if proto_thread.HasField("priority") else None
@@ -358,8 +378,12 @@ class Threads(Authenticated):
358
378
  select: list[ThreadSelectField] | None = None,
359
379
  extract: dict[str, str] | None = None,
360
380
  exclude_metadata: list[dict[str, Any]] | None = None,
381
+ created_after: datetime | None = None,
382
+ created_before: datetime | None = None,
383
+ raw_values: bool = False,
361
384
  ctx: Any = None,
362
385
  ) -> tuple[AsyncIterator[Thread], int | None]:
386
+ """Search threads. ``raw_values`` returns each thread's values undecoded."""
363
387
  metadata = metadata or {}
364
388
  values = values or {}
365
389
 
@@ -379,6 +403,8 @@ class Threads(Authenticated):
379
403
  "filters": auth_filters,
380
404
  "metadata_json": json_dumpb_optional(metadata),
381
405
  "values_json": json_dumpb_optional(values),
406
+ "created_after": created_after,
407
+ "created_before": created_before,
382
408
  "limit": limit,
383
409
  "offset": offset,
384
410
  "sort_by": _map_threads_sort_by(sort_by),
@@ -414,7 +440,10 @@ class Threads(Authenticated):
414
440
  pb.SearchThreadsRequest(**request_kwargs)
415
441
  )
416
442
 
417
- threads = [proto_to_thread(thread) for thread in response.threads]
443
+ threads = [
444
+ proto_to_thread(thread, raw_values=raw_values)
445
+ for thread in response.threads
446
+ ]
418
447
  cursor = offset + limit if len(threads) == limit else None
419
448
 
420
449
  async def generate_results():
@@ -431,6 +460,8 @@ class Threads(Authenticated):
431
460
  values: MetadataInput,
432
461
  status: ThreadStatus | None,
433
462
  exclude_metadata: list[dict[str, Any]] | None = None,
463
+ created_after: datetime | None = None,
464
+ created_before: datetime | None = None,
434
465
  ctx: Any = None,
435
466
  ) -> int:
436
467
  metadata = metadata or {}
@@ -450,6 +481,8 @@ class Threads(Authenticated):
450
481
  "filters": auth_filters,
451
482
  "metadata_json": json_dumpb_optional(metadata),
452
483
  "values_json": json_dumpb_optional(values),
484
+ "created_after": created_after,
485
+ "created_before": created_before,
453
486
  }
454
487
  if exclude_metadata:
455
488
  request_kwargs["exclude_metadata_json"] = json_dumpb(exclude_metadata)
@@ -475,6 +508,7 @@ class Threads(Authenticated):
475
508
  filters: Auth.types.FilterType | list[pb.AuthFilter] | None = None,
476
509
  include_ttl: bool = False,
477
510
  read_mask_paths: list[str] | None = None,
511
+ raw_values: bool = False,
478
512
  ) -> AsyncIterator[Thread]:
479
513
  """Get a thread by ID.
480
514
 
@@ -491,6 +525,8 @@ class Threads(Authenticated):
491
525
  (plus always-included identity/status columns) are queried.
492
526
  Use ["metadata", "config"] to skip the large "values" column, or
493
527
  [] for an auth/existence check that discards the thread body.
528
+ raw_values: When True, return the values as undecoded JSON, for a
529
+ caller that relays them without reading them.
494
530
  """
495
531
  auth_filters = await Threads.handle_event(
496
532
  ctx, "read", {"thread_id": str(thread_id)}
@@ -519,7 +555,7 @@ class Threads(Authenticated):
519
555
  client = await get_shared_client()
520
556
  response = await client.threads.Get(request)
521
557
 
522
- thread = proto_to_thread(response)
558
+ thread = proto_to_thread(response, raw_values=raw_values)
523
559
 
524
560
  async def generate_result():
525
561
  yield thread
@@ -862,6 +898,8 @@ class Threads(Authenticated):
862
898
  graph_id: str,
863
899
  checkpoint: dict[str, Any] | None = None,
864
900
  exception: BaseException | dict[str, Any] | None = None,
901
+ *,
902
+ refused_resume: bool = False,
865
903
  ) -> None:
866
904
  """Set thread and run status atomically via gRPC.
867
905
 
@@ -878,12 +916,15 @@ class Threads(Authenticated):
878
916
  graph_id: Graph ID to store in thread metadata
879
917
  checkpoint: Checkpoint payload containing values, next, tasks, etc.
880
918
  exception: Exception to store on thread (BaseException or serialized dict)
919
+ refused_resume: Strict resume refused the run's answer before anything
920
+ ran, so the thread keeps its error, or lack of one, as it was.
881
921
  """
882
922
  request_kwargs: dict[str, Any] = {
883
923
  "thread_id": pb.UUID(value=_normalize_uuid(thread_id)),
884
924
  "run_id": pb.UUID(value=_normalize_uuid(run_id)),
885
925
  "run_status": run_status,
886
926
  "graph_id": graph_id,
927
+ "refused_resume": refused_resume,
887
928
  }
888
929
 
889
930
  # Map checkpoint to proto if provided (reuses same helper as set_status)
@@ -29,7 +29,11 @@ import {
29
29
  import { AsyncLocalStorage } from "node:async_hooks";
30
30
  import * as fs from "node:fs/promises";
31
31
  import * as path from "node:path";
32
- import { serialiseAsDict, serializeError } from "./src/utils/serde.mjs";
32
+ import {
33
+ isUnknownInterruptError,
34
+ serialiseAsDict,
35
+ serializeError,
36
+ } from "./src/utils/serde.mjs";
33
37
  import * as importMap from "./src/utils/importMap.mjs";
34
38
  import { buildExperimentReplicas } from "./src/utils/experiment-tracing.mjs";
35
39
  import { ChainLifecycle } from "./src/lifecycle.mjs";
@@ -430,9 +434,14 @@ const handleStream = <T extends z.ZodType<any>>(
430
434
  await sendSSE(name, data);
431
435
  }
432
436
  } catch (error) {
433
- // Still print out the error, as the stack
434
- // trace is not carried over in Python
435
- logger.error(error);
437
+ if (isUnknownInterruptError(error)) {
438
+ // A refused stale answer is the client's, not a bug in the graph.
439
+ logger.warn(error.message);
440
+ } else {
441
+ // Still print out the error, as the stack
442
+ // trace is not carried over in Python
443
+ logger.error(error);
444
+ }
436
445
  // The socket is already gone once the request aborts, so skip the frame.
437
446
  if (!c.req.raw.signal.aborted) {
438
447
  await sendSSE("error", serializeError(error));
@@ -937,7 +946,10 @@ async function* streamEventsRequest(
937
946
  }
938
947
  } else if (
939
948
  data.event === "on_chat_model_stream" &&
940
- !data.tags?.includes("nostream")
949
+ // Same set as JS_NOSTREAM_TAGS in stream.py: the tags LangGraph.js's
950
+ // messages mode skips.
951
+ !data.tags?.includes("nostream") &&
952
+ !data.tags?.includes("langsmith:nostream")
941
953
  ) {
942
954
  const message: BaseMessageChunk = data.data.chunk;
943
955
  // Anthropic sets the id on the first chunk only; the rest get run-<runId>.
@@ -1,11 +1,18 @@
1
+ from collections.abc import Mapping
2
+ from typing import Any
3
+
4
+
1
5
  class RemoteException(Exception):
2
6
  error: str
3
7
 
4
- def __init__(self, error: str, *args: object) -> None:
8
+ def __init__(
9
+ self, error: str, *args: object, details: Mapping[str, Any] | None = None
10
+ ) -> None:
5
11
  super().__init__(*args)
6
12
  self.error = error
13
+ self.details = dict(details or {})
7
14
 
8
15
  # Used to nudge the serde to encode like BaseException
9
16
  # @see /api/langgraph_api/shared/serde.py:default
10
17
  def dict(self):
11
- return {"error": self.error, "message": str(self)}
18
+ return {"error": self.error, "message": str(self), **self.details}
@@ -30,7 +30,7 @@
30
30
  "@hono/node-server": ">=2.0.5",
31
31
  "esbuild": "^0.28.2",
32
32
  "langsmith": ">=0.11.0 <1.0.0",
33
- "vite": "^6.4.3"
33
+ "vite": "^6.4.5"
34
34
  },
35
35
  "devDependencies": {
36
36
  "@langchain/langgraph-sdk": "^1.5.4",
@@ -41,7 +41,7 @@
41
41
  "jose": "^6.2.12",
42
42
  "postgres": "^3.4.9",
43
43
  "prettier": "^3.9.10",
44
- "vite": "^8.3.5",
44
+ "vite": "^8.3.6",
45
45
  "vitest": "^5.0.5"
46
46
  },
47
47
  "packageManager": "yarn@1.22.22+sha512.a6b2f7906b721bba3d67d4aff083df04dad64c399707841b7acf00f6b133b7ac24255f2652fa22ae3534329dc6180534e98d17432037ff6fd140556e2bb3137e"
@@ -236,7 +236,15 @@ async def _client_stream(method: str, data: dict[str, Any]):
236
236
  sse = decoder.decode(line)
237
237
  if sse is not None:
238
238
  if sse.event == "error":
239
- raise RemoteException(sse.data["error"], sse.data["message"])
239
+ raise RemoteException(
240
+ sse.data["error"],
241
+ sse.data["message"],
242
+ details={
243
+ k: v
244
+ for k, v in sse.data.items()
245
+ if k not in ("error", "message")
246
+ },
247
+ )
240
248
  yield sse.data
241
249
 
242
250
 
@@ -20,7 +20,28 @@ export const serialiseAsDict = (obj: unknown) => {
20
20
  );
21
21
  };
22
22
 
23
+ interface UnknownInterruptErrorLike extends Error {
24
+ reason?: string;
25
+ interruptIds?: string[];
26
+ pendingIds?: string[];
27
+ }
28
+
29
+ // Matched by name: the graph may load its own copy of @langchain/langgraph.
30
+ export const isUnknownInterruptError = (
31
+ error: unknown,
32
+ ): error is UnknownInterruptErrorLike =>
33
+ error instanceof Error && error.name === "UnknownInterruptError";
34
+
23
35
  export const serializeError = (error: unknown) => {
36
+ if (isUnknownInterruptError(error)) {
37
+ return {
38
+ error: error.name,
39
+ message: error.message,
40
+ reason: error.reason,
41
+ interrupt_ids: error.interruptIds,
42
+ pending_ids: error.pendingIds,
43
+ };
44
+ }
24
45
  if (error instanceof Error) {
25
46
  return { error: error.name, message: error.message };
26
47
  }
@@ -362,85 +362,85 @@
362
362
  dependencies:
363
363
  "@tybys/wasm-util" "^0.10.1"
364
364
 
365
- "@oxc-project/types@=0.155.0":
366
- version "0.155.0"
367
- resolved "https://registry.yarnpkg.com/@oxc-project/types/-/types-0.155.0.tgz#a3525bff41bc0575839e95d2064635dd73dfef81"
368
- integrity sha512-SeE8JPwW1xs1tHeNycjUtUBdhorRa8o4jlvjwk49R7/Z291i+4DQa7JJIgOm/TaYQZx+QrPQbVJ/9c8dMIZN8Q==
369
-
370
- "@rolldown/binding-android-arm-eabi@1.2.15":
371
- version "1.2.15"
372
- resolved "https://registry.yarnpkg.com/@rolldown/binding-android-arm-eabi/-/binding-android-arm-eabi-1.2.15.tgz#3bdaa2e77aabbb78194500e22d46ebbdfc009558"
373
- integrity sha512-aLcgK9gIJ3YRvrrtfSBbRa27F5WrpiTaPulnFpsHPxpUHgFlSgnU4854MHwoRGEBhfRJDWCS2WQ7lIjskE9Olw==
374
-
375
- "@rolldown/binding-android-arm64@1.2.15":
376
- version "1.2.15"
377
- resolved "https://registry.yarnpkg.com/@rolldown/binding-android-arm64/-/binding-android-arm64-1.2.15.tgz#1bf2dd523e6b94be1366f397b946d7fd0de67f1d"
378
- integrity sha512-xD7DdZCrbThKuxNg7ooQmvp07ys4J/pnSEMTG3/OdOWl6daC67m/Q4fL78sRHMxTH/N4fGUbYhcPM0MF5WFHkg==
379
-
380
- "@rolldown/binding-darwin-arm64@1.2.15":
381
- version "1.2.15"
382
- resolved "https://registry.yarnpkg.com/@rolldown/binding-darwin-arm64/-/binding-darwin-arm64-1.2.15.tgz#99fdcc6be79f156331099de799f726809af142e7"
383
- integrity sha512-m2WuQ6r0B4OTYxyPpNLtXaMRbRDUbG8YQV2Q3KTdSSK8Th6KHCnC8jVCJt8bvYeSB5WivkkNbc85mKadaSdOxA==
384
-
385
- "@rolldown/binding-darwin-x64@1.2.15":
386
- version "1.2.15"
387
- resolved "https://registry.yarnpkg.com/@rolldown/binding-darwin-x64/-/binding-darwin-x64-1.2.15.tgz#752b56bcede7851580735a6cd48437eca936a182"
388
- integrity sha512-5RtnsHM36nodM9WbMy+zip0LGS/G+y5wro5RHrpOlr4ac24+1zSi9kiV2MP1myZeZ/ifEHfulQcWjnAXzc2C2A==
389
-
390
- "@rolldown/binding-freebsd-x64@1.2.15":
391
- version "1.2.15"
392
- resolved "https://registry.yarnpkg.com/@rolldown/binding-freebsd-x64/-/binding-freebsd-x64-1.2.15.tgz#f5104c1f4e50a63afae5d4d8c976a51d2facc8c6"
393
- integrity sha512-g3l09pyFqhu+135JKkbkwiKGQmwU5hUMUPJ4VdBADvuqR8d33L6H578rh8m7rtxbdp+VmX/+nzI7nvhSZlzpUQ==
394
-
395
- "@rolldown/binding-linux-arm-gnueabihf@1.2.15":
396
- version "1.2.15"
397
- resolved "https://registry.yarnpkg.com/@rolldown/binding-linux-arm-gnueabihf/-/binding-linux-arm-gnueabihf-1.2.15.tgz#b0a53d7f4b5293687de6ef8727469a5e2ad68312"
398
- integrity sha512-nIe3VugI97nGQtspPxDqA4sXMUpeiocKIP/CqpY/u/vgbT+alX+cVxu1C/oVBPKg4feNTmYovE91v4DgXvXNwQ==
399
-
400
- "@rolldown/binding-linux-arm64-gnu@1.2.15":
401
- version "1.2.15"
402
- resolved "https://registry.yarnpkg.com/@rolldown/binding-linux-arm64-gnu/-/binding-linux-arm64-gnu-1.2.15.tgz#b9832ceb22aca59cef2d20e267550fc83cd60fce"
403
- integrity sha512-iTBjXx+B5QSvgI89lJfmqh4wTh8NabR1YZIIN3hNx4zSG0EVfVqkOvLulNpG4251pbd6/IAmZ/LefVk1Y4rPhw==
404
-
405
- "@rolldown/binding-linux-arm64-musl@1.2.15":
406
- version "1.2.15"
407
- resolved "https://registry.yarnpkg.com/@rolldown/binding-linux-arm64-musl/-/binding-linux-arm64-musl-1.2.15.tgz#43d43aa8cd490ef529b37129755879c276ec899c"
408
- integrity sha512-uN26XOnVR7rqQupG3V9oAG2EGGatWjcJHOeDOHUFCh4TBWmP2tHTFoVN13aYbwfm0aHqJAEmcwhAu6sooIjfqQ==
409
-
410
- "@rolldown/binding-linux-ppc64-gnu@1.2.15":
411
- version "1.2.15"
412
- resolved "https://registry.yarnpkg.com/@rolldown/binding-linux-ppc64-gnu/-/binding-linux-ppc64-gnu-1.2.15.tgz#455df0b3a2ee6cacc004b8dad6295b43c39906e7"
413
- integrity sha512-9nWkcdd+H+XhaA3fQIwpHnKIrfx/PQ6rO0pivr78Og07tXlUlctBBJoEYLPfhTmCR/QxEVdn6uPjHV5SymPhdw==
414
-
415
- "@rolldown/binding-linux-s390x-gnu@1.2.15":
416
- version "1.2.15"
417
- resolved "https://registry.yarnpkg.com/@rolldown/binding-linux-s390x-gnu/-/binding-linux-s390x-gnu-1.2.15.tgz#a2f243b64683c72cd1b2fcbe67505a89d9c9d89b"
418
- integrity sha512-Ggh0ciFjLwIusLSLz7LZYEaGdxOAUJXI+Qu5JCbhPJJHEt8vP+IjRATTJheiJsdzzTYgUiHUiw3X1Ea3ZpMBdA==
419
-
420
- "@rolldown/binding-linux-x64-gnu@1.2.15":
421
- version "1.2.15"
422
- resolved "https://registry.yarnpkg.com/@rolldown/binding-linux-x64-gnu/-/binding-linux-x64-gnu-1.2.15.tgz#a514415b06af3517fcdbf228ebb7e06e8ed8385a"
423
- integrity sha512-FHg60rS6DBePAYZ9X9F67x+JObFdmgn6tupA1C/a3B+CufFmTD4mX+e8M75tCiAO3foR/6xwVBI0KQiI7sn/rw==
424
-
425
- "@rolldown/binding-linux-x64-musl@1.2.15":
426
- version "1.2.15"
427
- resolved "https://registry.yarnpkg.com/@rolldown/binding-linux-x64-musl/-/binding-linux-x64-musl-1.2.15.tgz#2b6ac8d0487af711741e1bc218cd49f113542f66"
428
- integrity sha512-/cvV/7v5VGz/moiz0XKRj2dE8DzsKyhIu1KpOvJGPjRywg3yscON889UGvAe8zfiJLHup7VLjBduoGWi3HusWQ==
429
-
430
- "@rolldown/binding-openharmony-arm64@1.2.15":
431
- version "1.2.15"
432
- resolved "https://registry.yarnpkg.com/@rolldown/binding-openharmony-arm64/-/binding-openharmony-arm64-1.2.15.tgz#70cdb40621eb478999a015019f68a97012f5e8cd"
433
- integrity sha512-MyzC5Hrv/sm+Z7TSGKP/j8001RO2xQm1zOpCNVL4j0cY/VhBZviludA2YFQ7i4lH6ZAXxQm0lcMdBzM+99mE7w==
434
-
435
- "@rolldown/binding-win32-arm64-msvc@1.2.15":
436
- version "1.2.15"
437
- resolved "https://registry.yarnpkg.com/@rolldown/binding-win32-arm64-msvc/-/binding-win32-arm64-msvc-1.2.15.tgz#8345076b3d3b4c362e5e8411aae227f729840a39"
438
- integrity sha512-+PgYiS+AH5omy6L45ZLxybasauJaj3M8buoT83D+nzPmCayXlxUV9hydhciCKVyIg0B/v0BtXPDE1uGqNwCPpg==
439
-
440
- "@rolldown/binding-win32-x64-msvc@1.2.15":
441
- version "1.2.15"
442
- resolved "https://registry.yarnpkg.com/@rolldown/binding-win32-x64-msvc/-/binding-win32-x64-msvc-1.2.15.tgz#04ff5f1e8786fd31a68d040661a50e6dae3c7669"
443
- integrity sha512-HFZd2QNQYn1JbIi+Hpd7H+r/lkWxcfIu28nirZ6eCn2LafuvmExMlb/P96Sfx5tf7pPArw39IdhmCF8vmV+NhQ==
365
+ "@oxc-project/types@=0.156.0":
366
+ version "0.156.0"
367
+ resolved "https://registry.yarnpkg.com/@oxc-project/types/-/types-0.156.0.tgz#00e35b1ead490d81b4c7fe1dbfe35fc55e89c5e6"
368
+ integrity sha512-1Duyg48TdJNdyhEB8Xn1L36bT9Pv6GUtlKjHxOys8xkaF/rQq3XJE+bAurSK/AgIz5mGFsb77cn9Pb20+WCScw==
369
+
370
+ "@rolldown/binding-android-arm-eabi@1.2.16":
371
+ version "1.2.16"
372
+ resolved "https://registry.yarnpkg.com/@rolldown/binding-android-arm-eabi/-/binding-android-arm-eabi-1.2.16.tgz#abc3e1d5aacd1983d32a490c3a8793770da3bd1a"
373
+ integrity sha512-ia3DwAs0OsMGS7+IConptSiyk9pEXkOx/AbJ2n/lAGxH3QkWQus1t8d7gnAT38FCU2sQu8lUbeR6AiZFv4JxaA==
374
+
375
+ "@rolldown/binding-android-arm64@1.2.16":
376
+ version "1.2.16"
377
+ resolved "https://registry.yarnpkg.com/@rolldown/binding-android-arm64/-/binding-android-arm64-1.2.16.tgz#85c4d52aeb79c69e8abd52e3ba3174bb946bcd49"
378
+ integrity sha512-kx5wBiMB6E7TEvpl2B9gjLU004BkvEm2Dr941BFjx/SontPwSzNuQUIoVKxHHoSjpFIfHMmcguyLOtyn0hObRg==
379
+
380
+ "@rolldown/binding-darwin-arm64@1.2.16":
381
+ version "1.2.16"
382
+ resolved "https://registry.yarnpkg.com/@rolldown/binding-darwin-arm64/-/binding-darwin-arm64-1.2.16.tgz#d188fd77cdb2b6dc140011a573203e374fdba2d8"
383
+ integrity sha512-qslZrXnKJU4cUpjoAmtAo/KQM9e2IRMlmpig6Zpwj+8KWxW8v+nkAf9216Bsek9lOC1jvg2yCjygCFo2f83msQ==
384
+
385
+ "@rolldown/binding-darwin-x64@1.2.16":
386
+ version "1.2.16"
387
+ resolved "https://registry.yarnpkg.com/@rolldown/binding-darwin-x64/-/binding-darwin-x64-1.2.16.tgz#eb84cc00765ce2f6c48d85624ebecaa2c88470ba"
388
+ integrity sha512-FdF+y48ND13eAyM2mQn+85kvAqNlvRWROy2rhgA463X/0Gv4vGtazZtfaF1mRBLscYvtOlh4QnLjOWiFzX69OQ==
389
+
390
+ "@rolldown/binding-freebsd-x64@1.2.16":
391
+ version "1.2.16"
392
+ resolved "https://registry.yarnpkg.com/@rolldown/binding-freebsd-x64/-/binding-freebsd-x64-1.2.16.tgz#d3c51e8a2cd2977eac7fff0e6655e2715a39328c"
393
+ integrity sha512-ddjqFM5e95AgLbUPtKIS7V1KTVlA0RUgCVr5mn+/IEhsdy3pr+Vuj/HZ7nlMN2FyxIwUktOH1LEPIQXO1v9y1Q==
394
+
395
+ "@rolldown/binding-linux-arm-gnueabihf@1.2.16":
396
+ version "1.2.16"
397
+ resolved "https://registry.yarnpkg.com/@rolldown/binding-linux-arm-gnueabihf/-/binding-linux-arm-gnueabihf-1.2.16.tgz#216c99c72c005c375d63d31060209b78a8983fec"
398
+ integrity sha512-tHdKWbFkFBI687iim3LIyIvyL7j66VvQYkDPss5Stn/qyE2tWkR1YD0dXmXPFKKqT/o5ZEJVsaRsWS2meQwGOA==
399
+
400
+ "@rolldown/binding-linux-arm64-gnu@1.2.16":
401
+ version "1.2.16"
402
+ resolved "https://registry.yarnpkg.com/@rolldown/binding-linux-arm64-gnu/-/binding-linux-arm64-gnu-1.2.16.tgz#4e03383b29c5ba30bbfdd06ec746c13e7dee12dd"
403
+ integrity sha512-FJiLGAblPBMlBEdbOqw6kW6QcXDWAf/oJu7gYs9ZJZwmg+K+/zjFLxPTIY9izJUzxzc24FHvmseyA0IvJSl17w==
404
+
405
+ "@rolldown/binding-linux-arm64-musl@1.2.16":
406
+ version "1.2.16"
407
+ resolved "https://registry.yarnpkg.com/@rolldown/binding-linux-arm64-musl/-/binding-linux-arm64-musl-1.2.16.tgz#d159c4c87ecda02962be95a1dccde1ef6934ccf2"
408
+ integrity sha512-hrJpblMsrQ58U9veWpbXzkhV5zStunds6HWLprqq1qauvgBr1E6P+24kLj6lSLI9vjRn/RYpjprhkHQPKGWpNg==
409
+
410
+ "@rolldown/binding-linux-ppc64-gnu@1.2.16":
411
+ version "1.2.16"
412
+ resolved "https://registry.yarnpkg.com/@rolldown/binding-linux-ppc64-gnu/-/binding-linux-ppc64-gnu-1.2.16.tgz#6e4be205f9d2188b2a996c0f82242beac7d573f6"
413
+ integrity sha512-qJd/dC6j6CwLG9/s/RP2nb1RZ0GIgj7Ioj7x/SYa3RzjVrlzrmH0fhIOpfvqQDeIsdP0loi+kHaMhJzY1PBIaA==
414
+
415
+ "@rolldown/binding-linux-s390x-gnu@1.2.16":
416
+ version "1.2.16"
417
+ resolved "https://registry.yarnpkg.com/@rolldown/binding-linux-s390x-gnu/-/binding-linux-s390x-gnu-1.2.16.tgz#7e68a24dbc387fdba75d95992974eddf39c9ddaf"
418
+ integrity sha512-Vx7Xg5uUJuNcujJjI70OICaH0EYj80BtOLZTSN7uOYg8QOLlyKnaG0IW7Fn/J0IpJsaKzmDKMhOQv1JBM9m9vg==
419
+
420
+ "@rolldown/binding-linux-x64-gnu@1.2.16":
421
+ version "1.2.16"
422
+ resolved "https://registry.yarnpkg.com/@rolldown/binding-linux-x64-gnu/-/binding-linux-x64-gnu-1.2.16.tgz#591cdec3e65bd701ba2e7b671ca9d694142dec2c"
423
+ integrity sha512-TNKhgE3uJTsTzatUSSYt0Kgo+Oa2uSlSjz4r1aEIea7HX6ULBym4fAlYUhG1i6pjNf2njfCUAfKwr6C3E9Xg1w==
424
+
425
+ "@rolldown/binding-linux-x64-musl@1.2.16":
426
+ version "1.2.16"
427
+ resolved "https://registry.yarnpkg.com/@rolldown/binding-linux-x64-musl/-/binding-linux-x64-musl-1.2.16.tgz#833ac527e031f51c2ac23a615a19ed111092088c"
428
+ integrity sha512-7chXdpjXZ8qG0+mIxECN3cT9kvhZ3/oZhMX6Pp876P7CDrIy8nJswva6Mq357JR7eYXfuskwZxMeV1SzoZdHrA==
429
+
430
+ "@rolldown/binding-openharmony-arm64@1.2.16":
431
+ version "1.2.16"
432
+ resolved "https://registry.yarnpkg.com/@rolldown/binding-openharmony-arm64/-/binding-openharmony-arm64-1.2.16.tgz#2991fbf22995469b1404afbf3850713fd917b525"
433
+ integrity sha512-Kwjt+7uNTJK5/MDkGWGVO2KQPnj8yAV75dMpfwyHZrJSXWHrniOB0aUEWlVYf3H1hOqFLIStLdM5QXq6bnKmOQ==
434
+
435
+ "@rolldown/binding-win32-arm64-msvc@1.2.16":
436
+ version "1.2.16"
437
+ resolved "https://registry.yarnpkg.com/@rolldown/binding-win32-arm64-msvc/-/binding-win32-arm64-msvc-1.2.16.tgz#52d854f35cccde05f6404262bd35342a372c79f2"
438
+ integrity sha512-/LH6WfjDRXXJz/p5xl4TmU+jpcnwcxbKEQBW/GZE0JHfN0lGIyTtsUEGaQ/q/GikkGJ2yLKe6pwm7AnEWO8pdw==
439
+
440
+ "@rolldown/binding-win32-x64-msvc@1.2.16":
441
+ version "1.2.16"
442
+ resolved "https://registry.yarnpkg.com/@rolldown/binding-win32-x64-msvc/-/binding-win32-x64-msvc-1.2.16.tgz#cda4755739a62beba28a612e243a9a4155c76821"
443
+ integrity sha512-1lv1KvX0Z871zfk7vw+dnXMMnHNyDwMzWG8Kv3HxDXMOhzCX4SHc7HK319fInP0i+0p9D8brkfzL7pJOaGl+tw==
444
444
 
445
445
  "@rolldown/pluginutils@^1.0.0":
446
446
  version "1.0.1"
@@ -1481,10 +1481,10 @@ postcss-value-parser@^4.1.0, postcss-value-parser@^4.2.0:
1481
1481
  resolved "https://registry.npmjs.org/postcss-value-parser/-/postcss-value-parser-4.2.0.tgz"
1482
1482
  integrity sha512-1NNCs6uurfkVbeXG4S8JFT9t19m45ICnif8zWLd5oPSZ50QnwMfK+H3jv408d4jw/7Bttv5axS5IiHoLaVNHeQ==
1483
1483
 
1484
- postcss@^8.4.41, postcss@^8.5.1, postcss@^8.5.3, postcss@^8.5.30:
1485
- version "8.5.31"
1486
- resolved "https://registry.yarnpkg.com/postcss/-/postcss-8.5.31.tgz#d44731fa02f8ae8371629ec7220e2ae0dbdf23ec"
1487
- integrity sha512-YUbWYCgErwnMAVkjUnYa+KlMBzGpHwiIt/DE7f0G33AuX2LH9UcTk6KgWxd3zRU+pN3u/C+Xl3EnMLM4Hea7Sg==
1484
+ postcss@^8.4.41, postcss@^8.5.1, postcss@^8.5.3, postcss@^8.5.32:
1485
+ version "8.5.32"
1486
+ resolved "https://registry.yarnpkg.com/postcss/-/postcss-8.5.32.tgz#fbccef8388a0c77508c713bfd37728d646595803"
1487
+ integrity sha512-LJlKCCAUFKOuZxipUdYw1NzIITEsPcgyOG9LkvRJvuKj/bRzbuRY0ARXvL0pWGpsZvn8jku+LMep2eU0seHp8g==
1488
1488
  dependencies:
1489
1489
  nanoid "^3.3.20"
1490
1490
  picocolors "^1.1.1"
@@ -1509,29 +1509,29 @@ readable-stream@^3.4.0, readable-stream@^3.6.2:
1509
1509
  string_decoder "^1.1.1"
1510
1510
  util-deprecate "^1.0.1"
1511
1511
 
1512
- rolldown@~1.2.14:
1513
- version "1.2.15"
1514
- resolved "https://registry.yarnpkg.com/rolldown/-/rolldown-1.2.15.tgz#d232b8201e1be3471d636375fe10af1dfc4eac35"
1515
- integrity sha512-6odND+fel5zVw3I4Yc2e69gvguDnX0CAAGiNDZSq4ik5WUcaLrkD2GLuog0XcODbor31hZ5ayEMgVDno+KPV5g==
1512
+ rolldown@~1.2.16:
1513
+ version "1.2.16"
1514
+ resolved "https://registry.yarnpkg.com/rolldown/-/rolldown-1.2.16.tgz#6c99aafa32361d578fbd945aeb43e533bb8f4c28"
1515
+ integrity sha512-bWvlMpFKiTfDKfnK7FC2MPgPeWCf/Kpwsq49ApdW+FQaBZb6O6dZ4MAPbPUjp7hYQrw/RobqCzn64BRrQecGHw==
1516
1516
  dependencies:
1517
- "@oxc-project/types" "=0.155.0"
1517
+ "@oxc-project/types" "=0.156.0"
1518
1518
  "@rolldown/pluginutils" "^1.0.0"
1519
1519
  optionalDependencies:
1520
- "@rolldown/binding-android-arm-eabi" "1.2.15"
1521
- "@rolldown/binding-android-arm64" "1.2.15"
1522
- "@rolldown/binding-darwin-arm64" "1.2.15"
1523
- "@rolldown/binding-darwin-x64" "1.2.15"
1524
- "@rolldown/binding-freebsd-x64" "1.2.15"
1525
- "@rolldown/binding-linux-arm-gnueabihf" "1.2.15"
1526
- "@rolldown/binding-linux-arm64-gnu" "1.2.15"
1527
- "@rolldown/binding-linux-arm64-musl" "1.2.15"
1528
- "@rolldown/binding-linux-ppc64-gnu" "1.2.15"
1529
- "@rolldown/binding-linux-s390x-gnu" "1.2.15"
1530
- "@rolldown/binding-linux-x64-gnu" "1.2.15"
1531
- "@rolldown/binding-linux-x64-musl" "1.2.15"
1532
- "@rolldown/binding-openharmony-arm64" "1.2.15"
1533
- "@rolldown/binding-win32-arm64-msvc" "1.2.15"
1534
- "@rolldown/binding-win32-x64-msvc" "1.2.15"
1520
+ "@rolldown/binding-android-arm-eabi" "1.2.16"
1521
+ "@rolldown/binding-android-arm64" "1.2.16"
1522
+ "@rolldown/binding-darwin-arm64" "1.2.16"
1523
+ "@rolldown/binding-darwin-x64" "1.2.16"
1524
+ "@rolldown/binding-freebsd-x64" "1.2.16"
1525
+ "@rolldown/binding-linux-arm-gnueabihf" "1.2.16"
1526
+ "@rolldown/binding-linux-arm64-gnu" "1.2.16"
1527
+ "@rolldown/binding-linux-arm64-musl" "1.2.16"
1528
+ "@rolldown/binding-linux-ppc64-gnu" "1.2.16"
1529
+ "@rolldown/binding-linux-s390x-gnu" "1.2.16"
1530
+ "@rolldown/binding-linux-x64-gnu" "1.2.16"
1531
+ "@rolldown/binding-linux-x64-musl" "1.2.16"
1532
+ "@rolldown/binding-openharmony-arm64" "1.2.16"
1533
+ "@rolldown/binding-win32-arm64-msvc" "1.2.16"
1534
+ "@rolldown/binding-win32-x64-msvc" "1.2.16"
1535
1535
 
1536
1536
  rollup@^4.34.9:
1537
1537
  version "4.60.3"
@@ -1718,10 +1718,10 @@ uuid@^14.0.3:
1718
1718
  resolved "https://registry.yarnpkg.com/uuid/-/uuid-14.0.3.tgz#48c9b0dcf5a42d983c23162399eeb9af8b2cc617"
1719
1719
  integrity sha512-Sc5u1VVln93y1Xnz4R+CunOZc7R9LUcTmhj7Rc7Eg3HVcf7rVn2FOoa812fe0W8p3jD7xeoGSYbfqCGGH2B6xw==
1720
1720
 
1721
- vite@^6.4.3:
1722
- version "6.4.3"
1723
- resolved "https://registry.yarnpkg.com/vite/-/vite-6.4.3.tgz#85a164db7ce706f2a776812efa2b340f1721858e"
1724
- integrity sha512-NTKlcQjlAK7MlQoyb6LgaqHc8sso/pVyUJYWMws3jg21uTJw/LddqIFPcPqP6PzpgbIcZyKI85sFE4HBrQDA8A==
1721
+ vite@^6.4.5:
1722
+ version "6.4.5"
1723
+ resolved "https://registry.yarnpkg.com/vite/-/vite-6.4.5.tgz#8da9987120422f92e432b6d25535b82cee867dad"
1724
+ integrity sha512-4enwjFfi4IwtEh0w+jPzpLVOFQiPHmmzPxcHXQOyEur47o6u0jE573DmGpjA+7irXoMLYRZD5ZaFUEneS3abPg==
1725
1725
  dependencies:
1726
1726
  esbuild "^0.25.0"
1727
1727
  fdir "^6.4.4"
@@ -1732,15 +1732,15 @@ vite@^6.4.3:
1732
1732
  optionalDependencies:
1733
1733
  fsevents "~2.3.3"
1734
1734
 
1735
- vite@^8.3.5:
1736
- version "8.3.5"
1737
- resolved "https://registry.yarnpkg.com/vite/-/vite-8.3.5.tgz#9614f66026cb92fe486cb9d3c90780b2a69fc85d"
1738
- integrity sha512-z1YpjieJ9g0ebTmQpLBv/oq9E3F9EIlOe+7LahW8SrE3LTiG3udBRUXQOlYXP9b+IC2q2phHeVxj9xGlw34OEQ==
1735
+ vite@^8.3.6:
1736
+ version "8.3.6"
1737
+ resolved "https://registry.yarnpkg.com/vite/-/vite-8.3.6.tgz#ff2eb6b0b18e910c08a79c59a80faebecd422808"
1738
+ integrity sha512-UI7dK29NnS54Fk+mmo7o+jI6U8Fp7hDl+X5Q1k45WH+d4dSlbLVUETGQ+hfkNgvLQGyoElPj837nZyv4MBc0VA==
1739
1739
  dependencies:
1740
1740
  lightningcss "^1.33.0"
1741
1741
  picomatch "^4.0.7"
1742
- postcss "^8.5.30"
1743
- rolldown "~1.2.14"
1742
+ postcss "^8.5.32"
1743
+ rolldown "~1.2.16"
1744
1744
  tinyglobby "^0.2.17"
1745
1745
  optionalDependencies:
1746
1746
  fsevents "~2.3.3"
langgraph_api/metadata.py CHANGED
@@ -20,6 +20,7 @@ from langgraph_api.config import (
20
20
  USES_INDEXING,
21
21
  USES_STORE_TTL,
22
22
  USES_THREAD_TTL,
23
+ langsmith_api_url,
23
24
  )
24
25
  from langgraph_api.feature_flags import DELTA_CHANNEL_SUPPORT, IS_INMEM_BACKEND
25
26
  from langgraph_api.graph import GRAPHS, is_js_graph
@@ -81,17 +82,9 @@ FROM_TIMESTAMP = datetime.now(UTC).isoformat()
81
82
  BEACON_ENDPOINT = "https://beacon.langchain.com/v1/beacon/metadata/submit"
82
83
 
83
84
  # LangChain auth endpoint for API key submissions
84
- LANGCHAIN_METADATA_ENDPOINT = None
85
- if LANGSMITH_AUTH_ENDPOINT:
86
- if "/api/v1" in LANGSMITH_AUTH_ENDPOINT:
87
- # If the endpoint already has /api/v1 (for self-hosted control plane deployments), we assume it's the correct format
88
- LANGCHAIN_METADATA_ENDPOINT = (
89
- LANGSMITH_AUTH_ENDPOINT.rstrip("/") + "/metadata/submit"
90
- )
91
- else:
92
- LANGCHAIN_METADATA_ENDPOINT = (
93
- LANGSMITH_AUTH_ENDPOINT.rstrip("/") + "/v1/metadata/submit"
94
- )
85
+ LANGCHAIN_METADATA_ENDPOINT = (
86
+ langsmith_api_url("/metadata/submit") if LANGSMITH_AUTH_ENDPOINT else None
87
+ )
95
88
 
96
89
 
97
90
  def _dependency_version_metadata() -> dict[str, str]:
@@ -164,6 +164,9 @@ COUNTER_RUN_CANCELED_BY_REQUEST = def_counter(
164
164
  COUNTER_RUN_FAILED_RETRIABLE = def_counter(
165
165
  "run_failed_retriable_counter", METRIC_TIER_CRITICAL
166
166
  )
167
+ # Legacy single-process terminal-failure counter (internal / DD OTLP).
168
+ # Multi-process emits the public Go twin run_failed_terminal_counter instead;
169
+ # Go also dual-emits this name for continuity.
167
170
  COUNTER_RUN_FAILED_AFTER_RETRY = def_counter(
168
171
  "run_failed_after_retry_counter", METRIC_TIER_CRITICAL
169
172
  )
@@ -594,7 +597,16 @@ class OTelMetricsReporter:
594
597
  # global prometheus_client REGISTRY, which the /metrics
595
598
  # endpoint serves via generate_latest() (see api/meta.py).
596
599
  # Prometheus serves only Deployment-UI metrics.
597
- readers.append(_LSDPrometheusReader())
600
+ # Multi-process merges Go's public registry (which owns
601
+ # target_info); disable Python's twin so scrapes stay unique.
602
+ readers.append(
603
+ _LSDPrometheusReader(
604
+ disable_target_info=(
605
+ config.DISPATCH_MODE
606
+ == config.DispatchMode.MULTI_PROCESS
607
+ )
608
+ )
609
+ )
598
610
  self._prom_enabled = True
599
611
 
600
612
  if not readers:
@@ -320,6 +320,7 @@ async def create_valid_run(
320
320
  "resumable": stream_resumable,
321
321
  "checkpoint_during": payload.get("checkpoint_during", True),
322
322
  "durability": durability,
323
+ **({"strict_resume": True} if payload.get("strict_resume") else {}),
323
324
  },
324
325
  metadata=payload.get("metadata"),
325
326
  status="pending",