langgraph-api 0.16.0.dev9__py3-none-any.whl → 0.16.0.dev10__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.
langgraph_api/__init__.py CHANGED
@@ -1 +1 @@
1
- __version__ = "0.16.0.dev9"
1
+ __version__ = "0.16.0.dev10"
langgraph_api/stream.py CHANGED
@@ -717,14 +717,16 @@ async def _consume_inline(
717
717
  except Exception as e:
718
718
  if isinstance(e, ExceptionGroup):
719
719
  e = e.exceptions[0]
720
- with suppress(Exception):
721
- await Runs.Stream.publish(
722
- run_id,
723
- "error",
724
- await run_in_executor(None, json_dumpb, e),
725
- thread_id=thread_id,
726
- )
727
720
  if isinstance(e, StreamPublishException):
721
+ # We swallow this and report the run as complete, so the worker
722
+ # never sees it and cannot surface it. Emit it to the client here.
723
+ with suppress(Exception):
724
+ await Runs.Stream.publish(
725
+ run_id,
726
+ "error",
727
+ await run_in_executor(None, json_dumpb, e),
728
+ thread_id=thread_id,
729
+ )
728
730
  await logger.aerror(
729
731
  "Suppressing stream consume exception",
730
732
  run_id=str(run_id),
@@ -815,9 +817,6 @@ async def _consume_async_queue(
815
817
  except Exception as e:
816
818
  if isinstance(e, ExceptionGroup):
817
819
  e = e.exceptions[0]
818
- with suppress(Exception):
819
- error_payload = await run_in_executor(None, json_dumpb, e)
820
- await _enqueue(("error", error_payload, "error", False))
821
820
  raise e
822
821
  finally:
823
822
  with suppress(Exception):
langgraph_api/worker.py CHANGED
@@ -1,6 +1,7 @@
1
1
  import asyncio
2
2
  import time
3
3
  import uuid
4
+ from contextlib import suppress
4
5
  from datetime import UTC, datetime
5
6
  from typing import Any
6
7
 
@@ -33,6 +34,7 @@ from langgraph_api.metrics_otlp import (
33
34
  get_otlp_metrics_reporter,
34
35
  )
35
36
  from langgraph_api.schema import RUN_KWARGS_ENCRYPTION_SUBFIELDS, Run, StreamMode
37
+ from langgraph_api.serde import json_dumpb
36
38
  from langgraph_api.stream import AnyStream, consume
37
39
  from langgraph_api.worker_runtime import (
38
40
  ALL_RETRIABLE_EXCEPTIONS,
@@ -360,6 +362,18 @@ async def worker(
360
362
  if isinstance(exception, UserTimeout):
361
363
  exception = exception.timeout_error
362
364
 
365
+ # Sole emitter of the terminal `error` stream event: consume()
366
+ # re-raises without emitting, so a retriable attempt stays silent
367
+ # until the run actually fails. Emit before the status write so raw
368
+ # SSE clients (no status fallback) see it even if that write fails.
369
+ with suppress(Exception):
370
+ await Runs.Stream.publish(
371
+ run_id,
372
+ "error",
373
+ json_dumpb(exception),
374
+ thread_id=run["thread_id"],
375
+ )
376
+
363
377
  # We're outside the original `except` block, so build exc_info manually.
364
378
  # This preserves traceback logging for non-remote exceptions.
365
379
  exc_info = None
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: langgraph-api
3
- Version: 0.16.0.dev9
3
+ Version: 0.16.0.dev10
4
4
  Author-email: Will Fu-Hinthorn <will@langchain.dev>, Josh Rogers <josh@langchain.dev>, Parker Rule <parker@langchain.dev>
5
5
  License: Elastic-2.0
6
6
  License-File: LICENSE
@@ -1,4 +1,4 @@
1
- langgraph_api/__init__.py,sha256=nXwPSNNZLTX6fAo7c0hB4znTaE-pA57XXxlNKC6OCvQ,28
1
+ langgraph_api/__init__.py,sha256=um_WiVh9AnzsDQ_uwuBR_l3Qs5H4H5XB_4UEwk6ILAQ,29
2
2
  langgraph_api/_factory_utils.py,sha256=_FqW0olMu2PGLsnRq0ylt3a4jDCe12YIFHExMXI6Nyo,5976
3
3
  langgraph_api/asgi_transport.py,sha256=XApY3lIWBZTMbbsl8dDJzl0cLGirmAGE0SifqZUnXvs,11896
4
4
  langgraph_api/asyncio.py,sha256=smqyAoO9nIyPPQRw1IVSCh85fwoZP4PEo-5dDhxGruc,10676
@@ -30,13 +30,13 @@ langgraph_api/server.py,sha256=L1jGWkvK0fDewyus0xYvYmwQ6k775uNn_mXSKUnIOK0,11245
30
30
  langgraph_api/sse.py,sha256=cChZ7raQUHp8p5BreE_5wMBR8lFO0n7746sV8_HQOrc,4822
31
31
  langgraph_api/state.py,sha256=SC6kOmKXVV2puU37rc3yYveZFgnqP5uI_WidDyE5oXQ,4763
32
32
  langgraph_api/store.py,sha256=i-jVfWzDEmPESVofh1tNWbo0HMLiLz_BSKKV4QjN-dE,5027
33
- langgraph_api/stream.py,sha256=Op8mzE4xv46q6QwZfe8GF5soD9cV0FGToTVVDuiEghA,34080
33
+ langgraph_api/stream.py,sha256=0adXgdp7GjLOG5juSViRlae9tSHvKCFYn2eNUi400w0,34097
34
34
  langgraph_api/stream_v2.py,sha256=cmbE566boEgKkjcqqf8OvDqjWh8VzvCCsTTlvUF5Drg,10762
35
35
  langgraph_api/traceblock.py,sha256=GhgAtLhAQ8Z8LHtRQq3par-rfPpRBQp2Q7WBACJq1NI,677
36
36
  langgraph_api/tracing_session.py,sha256=gmfv-BW1XRar6suVur1P4rTVKWkjElDEb2hhkBduWOs,728
37
37
  langgraph_api/validation.py,sha256=9MERrOB1aNfVh7Wkrz8Ziwff6WWeXVvuKtoNPovUw4U,14714
38
38
  langgraph_api/webhook.py,sha256=qXEtkE6orek2POeOQmPRsEarJgXIYp-LBrZB-OwITxc,9572
39
- langgraph_api/worker.py,sha256=8aLClQzS4L6uvQprRwpTQnKWKl2h-4plBtTRLv-0QdE,16140
39
+ langgraph_api/worker.py,sha256=8P82VxTHlf3t4088n-nXifsZPcb0hb1sd-3902jjK1Q,16820
40
40
  langgraph_api/worker_runtime.py,sha256=YDXawL91b2VT8XeXBw_bIoHhkmVqdhUI3Efw50H4lgY,7188
41
41
  langgraph_api/_checkpointer/__init__.py,sha256=ofJTJLGy7Hsuzhj-2dpfDvrDloM0BzlhTzvZOdR9K8U,2223
42
42
  langgraph_api/_checkpointer/_adapter.py,sha256=idGYL-FwyVtUXcmhvfYboARfQAkoj0aFD40L5h9N7F8,22289
@@ -252,8 +252,8 @@ langgraph_grpc_common/proto/store_pb2.py,sha256=JKcuJK0YUC1BSwLUZJWHCQ7AWkzVS9Kf
252
252
  langgraph_grpc_common/proto/store_pb2.pyi,sha256=ItSuXbA2X9bQlHtuEjDGi0fT_gJj2b0sr7XuQkybe3s,28983
253
253
  langgraph_grpc_common/proto/store_pb2_grpc.py,sha256=Kyt8eV2NXkjh3be_BYytGdD19kNf74961cruonMvCrw,3300
254
254
  langgraph_grpc_common/proto/store_pb2_grpc.pyi,sha256=oS1h2cDoq2OjyM8xazcmc8LwRDC5oCAD0zto2QUmPQw,2027
255
- langgraph_api-0.16.0.dev9.dist-info/METADATA,sha256=IGWFw9d1y-xRO7jRDVcGAOK39iQWdpibKDs0tsQrS14,5879
256
- langgraph_api-0.16.0.dev9.dist-info/WHEEL,sha256=W3fkpkm7-wf9vBI5Z-7s0eWkeM-spu78I8Neb98DeEg,87
257
- langgraph_api-0.16.0.dev9.dist-info/entry_points.txt,sha256=hGedv8n7cgi41PypMfinwS_HfCwA7xJIfS0jAp8htV8,78
258
- langgraph_api-0.16.0.dev9.dist-info/licenses/LICENSE,sha256=ZPwVR73Biwm3sK6vR54djCrhaRiM4cAD2zvOQZV8Xis,3859
259
- langgraph_api-0.16.0.dev9.dist-info/RECORD,,
255
+ langgraph_api-0.16.0.dev10.dist-info/METADATA,sha256=JTEK5YSa2qtpKqP5vhcIA_b2wr74MZfUO51t_DE7JLI,5880
256
+ langgraph_api-0.16.0.dev10.dist-info/WHEEL,sha256=W3fkpkm7-wf9vBI5Z-7s0eWkeM-spu78I8Neb98DeEg,87
257
+ langgraph_api-0.16.0.dev10.dist-info/entry_points.txt,sha256=hGedv8n7cgi41PypMfinwS_HfCwA7xJIfS0jAp8htV8,78
258
+ langgraph_api-0.16.0.dev10.dist-info/licenses/LICENSE,sha256=ZPwVR73Biwm3sK6vR54djCrhaRiM4cAD2zvOQZV8Xis,3859
259
+ langgraph_api-0.16.0.dev10.dist-info/RECORD,,