langgraph-runtime-inmem 0.39.0.dev4__tar.gz → 0.39.0.dev6__tar.gz

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 (19) hide show
  1. {langgraph_runtime_inmem-0.39.0.dev4 → langgraph_runtime_inmem-0.39.0.dev6}/PKG-INFO +1 -1
  2. {langgraph_runtime_inmem-0.39.0.dev4 → langgraph_runtime_inmem-0.39.0.dev6}/langgraph_runtime_inmem/__init__.py +1 -1
  3. {langgraph_runtime_inmem-0.39.0.dev4 → langgraph_runtime_inmem-0.39.0.dev6}/langgraph_runtime_inmem/ops.py +49 -10
  4. {langgraph_runtime_inmem-0.39.0.dev4 → langgraph_runtime_inmem-0.39.0.dev6}/uv.lock +6 -6
  5. {langgraph_runtime_inmem-0.39.0.dev4 → langgraph_runtime_inmem-0.39.0.dev6}/.gitignore +0 -0
  6. {langgraph_runtime_inmem-0.39.0.dev4 → langgraph_runtime_inmem-0.39.0.dev6}/Makefile +0 -0
  7. {langgraph_runtime_inmem-0.39.0.dev4 → langgraph_runtime_inmem-0.39.0.dev6}/README.md +0 -0
  8. {langgraph_runtime_inmem-0.39.0.dev4 → langgraph_runtime_inmem-0.39.0.dev6}/langgraph_runtime_inmem/_persistence.py +0 -0
  9. {langgraph_runtime_inmem-0.39.0.dev4 → langgraph_runtime_inmem-0.39.0.dev6}/langgraph_runtime_inmem/checkpoint.py +0 -0
  10. {langgraph_runtime_inmem-0.39.0.dev4 → langgraph_runtime_inmem-0.39.0.dev6}/langgraph_runtime_inmem/database.py +0 -0
  11. {langgraph_runtime_inmem-0.39.0.dev4 → langgraph_runtime_inmem-0.39.0.dev6}/langgraph_runtime_inmem/encryption.py +0 -0
  12. {langgraph_runtime_inmem-0.39.0.dev4 → langgraph_runtime_inmem-0.39.0.dev6}/langgraph_runtime_inmem/inmem_stream.py +0 -0
  13. {langgraph_runtime_inmem-0.39.0.dev4 → langgraph_runtime_inmem-0.39.0.dev6}/langgraph_runtime_inmem/lifespan.py +0 -0
  14. {langgraph_runtime_inmem-0.39.0.dev4 → langgraph_runtime_inmem-0.39.0.dev6}/langgraph_runtime_inmem/metrics.py +0 -0
  15. {langgraph_runtime_inmem-0.39.0.dev4 → langgraph_runtime_inmem-0.39.0.dev6}/langgraph_runtime_inmem/queue.py +0 -0
  16. {langgraph_runtime_inmem-0.39.0.dev4 → langgraph_runtime_inmem-0.39.0.dev6}/langgraph_runtime_inmem/retry.py +0 -0
  17. {langgraph_runtime_inmem-0.39.0.dev4 → langgraph_runtime_inmem-0.39.0.dev6}/langgraph_runtime_inmem/routes.py +0 -0
  18. {langgraph_runtime_inmem-0.39.0.dev4 → langgraph_runtime_inmem-0.39.0.dev6}/langgraph_runtime_inmem/store.py +0 -0
  19. {langgraph_runtime_inmem-0.39.0.dev4 → langgraph_runtime_inmem-0.39.0.dev6}/pyproject.toml +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: langgraph-runtime-inmem
3
- Version: 0.39.0.dev4
3
+ Version: 0.39.0.dev6
4
4
  Summary: Inmem implementation for the LangGraph API server.
5
5
  Author-email: Will Fu-Hinthorn <will@langchain.dev>
6
6
  License: Elastic-2.0
@@ -11,7 +11,7 @@ from langgraph_runtime_inmem import (
11
11
  store,
12
12
  )
13
13
 
14
- __version__ = "0.39.0.dev4"
14
+ __version__ = "0.39.0.dev6"
15
15
  __all__ = [
16
16
  "ops",
17
17
  "database",
@@ -194,6 +194,8 @@ async def _save_thread_status(
194
194
  checkpoint: CheckpointPayload | None,
195
195
  exception: BaseException | None,
196
196
  now: datetime,
197
+ *,
198
+ refused: bool = False,
197
199
  ) -> None:
198
200
  """Write a thread's status and error from the facts this update knows.
199
201
 
@@ -201,21 +203,26 @@ async def _save_thread_status(
201
203
  Without a checkpoint there is nothing to replace values, interrupts and
202
204
  has_next with, so the thread keeps the ones it already has. has_next is
203
205
  recorded only once the thread is saved, so a failed save can't leave the two
204
- apart.
206
+ apart. A resume that strict mode refused ran nothing, so the thread keeps the
207
+ error, or lack of one, it had.
205
208
  """
206
209
  from langgraph_api.serde import json_dumpb, json_loads # noqa: PLC0415
207
210
 
208
- failure = _thread_failure(exception)
211
+ failure = None if refused else _thread_failure(exception)
209
212
  has_next = None if checkpoint is None else bool(checkpoint["next"])
210
213
 
211
214
  update: dict = {
212
215
  "updated_at": now,
213
216
  "state_updated_at": now,
214
217
  "status": _thread_status(
215
- conn, thread_id, failed=failure is not None, has_next=has_next
218
+ conn,
219
+ thread_id,
220
+ failed=None if refused else failure is not None,
221
+ has_next=has_next,
216
222
  ),
217
- "error": json_loads(json_dumpb(failure)) if failure else None,
218
223
  }
224
+ if not refused:
225
+ update["error"] = json_loads(json_dumpb(failure)) if failure else None
219
226
  if checkpoint is not None:
220
227
  update["values"] = json_loads(json_dumpb(checkpoint["values"]))
221
228
  update["interrupts"] = json_loads(
@@ -236,13 +243,17 @@ async def _save_thread_status(
236
243
  # facts apart from the thread.
237
244
  if has_next is not None:
238
245
  _thread_has_next(conn)[thread_id] = has_next
239
- _thread_failed(conn)[thread_id] = failure is not None
246
+ if not refused:
247
+ _thread_failed(conn)[thread_id] = failure is not None
240
248
 
241
249
 
242
250
  def _run_stream_mode_matches(event_mode: str, stream_mode: list[str] | None) -> bool:
243
251
  """Return True if a published run-stream event matches the join filter."""
244
- # A run's error is its outcome, not a selectable mode, so no filter drops it.
245
- if not stream_mode or event_mode == "error":
252
+ # The interrupts a run answers are for the thread's other clients.
253
+ if event_mode == "interrupts":
254
+ return False
255
+ # A run's error and end are its outcome, not selectable modes, so no filter drops them.
256
+ if not stream_mode or event_mode in ("error", "end"):
246
257
  return True
247
258
  if event_mode in stream_mode:
248
259
  return True
@@ -1523,6 +1534,8 @@ class Threads(Authenticated):
1523
1534
  graph_id: str,
1524
1535
  checkpoint: CheckpointPayload | None = None,
1525
1536
  exception: BaseException | None = None,
1537
+ *,
1538
+ refused_resume: bool = False,
1526
1539
  ) -> None:
1527
1540
  """Set the status of both thread and run atomically in a single query.
1528
1541
 
@@ -1536,6 +1549,8 @@ class Threads(Authenticated):
1536
1549
  run_status: New status for the run (or "rollback" to delete the run)
1537
1550
  checkpoint: Checkpoint payload for thread status calculation
1538
1551
  exception: Exception that occurred (affects thread status)
1552
+ refused_resume: Strict resume refused the run's answer before anything
1553
+ ran, so the thread keeps its error, or lack of one, as it was.
1539
1554
  """
1540
1555
  # No auth since it's internal
1541
1556
  thread_id = _ensure_uuid(thread_id)
@@ -1566,13 +1581,21 @@ class Threads(Authenticated):
1566
1581
  if run.get("cancel_action") == "rollback":
1567
1582
  # A rollback recorded while the run ran wins over the signal its worker saw first, as in Go.
1568
1583
  run_status, checkpoint, exception = "rollback", None, None
1584
+ refused_resume = False
1569
1585
  if run_status == "rollback":
1570
1586
  await Runs.delete(conn, run_id, thread_id=run["thread_id"])
1571
1587
  else:
1572
1588
  run.update({"status": run_status, "updated_at": now})
1573
1589
  thread["metadata"]["graph_id"] = graph_id
1574
1590
  await _save_thread_status(
1575
- conn, thread_id, thread, stored_thread, checkpoint, exception, now
1591
+ conn,
1592
+ thread_id,
1593
+ thread,
1594
+ stored_thread,
1595
+ checkpoint,
1596
+ exception,
1597
+ now,
1598
+ refused=refused_resume,
1576
1599
  )
1577
1600
 
1578
1601
  @staticmethod
@@ -1863,8 +1886,13 @@ class Threads(Authenticated):
1863
1886
  config: Config,
1864
1887
  subgraphs: bool = False,
1865
1888
  ctx: Auth.types.BaseAuthContext | None = None,
1889
+ channels: Sequence[str] | None = None,
1866
1890
  ) -> StateSnapshot:
1867
- """Get state for a thread."""
1891
+ """Get state for a thread.
1892
+
1893
+ ``channels`` is accepted for parity with the gRPC runtime; the
1894
+ in-memory checkpointer always loads whole checkpoints.
1895
+ """
1868
1896
  from langgraph_api.graph import get_graph # noqa: PLC0415
1869
1897
  from langgraph_api.store import get_store # noqa: PLC0415
1870
1898
 
@@ -3125,6 +3153,11 @@ class Runs(Authenticated):
3125
3153
  else None
3126
3154
  )
3127
3155
 
3156
+ # A run that cancels the runs in flight replaces them, so refusing its
3157
+ # answer would stop the agent mid-turn: it never resumes strictly.
3158
+ if multitask_strategy in ("interrupt", "rollback") and inflight_runs:
3159
+ kwargs = {k: v for k, v in kwargs.items() if k != "strict_resume"}
3160
+
3128
3161
  # Create new run
3129
3162
  configurable = Runs._merge_jsonb(
3130
3163
  Runs._get_configurable(assistant["config"]),
@@ -3225,8 +3258,14 @@ class Runs(Authenticated):
3225
3258
  *,
3226
3259
  thread_id: UUID,
3227
3260
  ctx: Auth.types.BaseAuthContext | None = None,
3261
+ read_mask_paths: list[str] | None = None,
3228
3262
  ) -> AsyncIterator[Run]:
3229
- """Get a run by ID."""
3263
+ """Get a run by ID.
3264
+
3265
+ Args:
3266
+ read_mask_paths: Column restriction hint for the postgres runtime;
3267
+ ignored for inmem since there's no input-column I/O to skip.
3268
+ """
3230
3269
 
3231
3270
  run_id, thread_id = _ensure_uuid(run_id), _ensure_uuid(thread_id)
3232
3271
  filters = await Runs.handle_event(
@@ -283,7 +283,7 @@ wheels = [
283
283
 
284
284
  [[package]]
285
285
  name = "langgraph"
286
- version = "1.2.6"
286
+ version = "1.2.19"
287
287
  source = { registry = "https://pypi.org/simple" }
288
288
  dependencies = [
289
289
  { name = "langchain-core" },
@@ -293,9 +293,9 @@ dependencies = [
293
293
  { name = "pydantic" },
294
294
  { name = "xxhash" },
295
295
  ]
296
- sdist = { url = "https://files.pythonhosted.org/packages/02/7a/ea09b05bb0cbddfa43bd34fc581357e87fc3f21a751cc0d419688c3106da/langgraph-1.2.6.tar.gz", hash = "sha256:f9b45a34f13930c94d96cdb76277447ad2cc70ec2d18cd2764d7fdadb36cdc1b", size = 714400, upload-time = "2026-06-18T20:58:21.514Z" }
296
+ sdist = { url = "https://files.pythonhosted.org/packages/ba/10/329dc49ce3fc40e36faafd407f08607fe3fab75613e709a66758b53faac2/langgraph-1.2.19.tar.gz", hash = "sha256:4a00fa1aad2b5fc2d3a789a8e9eaf993f76218ca924b434902ecf1bbaaf300f6", size = 782618, upload-time = "2026-10-30T22:23:32.962Z" }
297
297
  wheels = [
298
- { url = "https://files.pythonhosted.org/packages/89/32/772db1b00a9fe42f50320d1aa20caefb76e621eff1f7218b9918093d631d/langgraph-1.2.6-py3-none-any.whl", hash = "sha256:1cf94d3ca124f84f77ce408fa1b06c3dee680a8aafffe364a8fd5d7d03eb8695", size = 246132, upload-time = "2026-06-18T20:58:20.335Z" },
298
+ { url = "https://files.pythonhosted.org/packages/d7/9e/bd29e368fb16feea8d24270d377d56c34b49afea371717124f19cdfa890c/langgraph-1.2.19-py3-none-any.whl", hash = "sha256:6094a5cbed52a77d8c74c276fcd2056abde7b2836eab1c7a6b74bacbd1a269b3", size = 262285, upload-time = "2026-10-30T22:23:31.334Z" },
299
299
  ]
300
300
 
301
301
  [[package]]
@@ -388,7 +388,7 @@ dev = [
388
388
 
389
389
  [[package]]
390
390
  name = "langgraph-sdk"
391
- version = "0.4.4"
391
+ version = "0.4.11"
392
392
  source = { registry = "https://pypi.org/simple" }
393
393
  dependencies = [
394
394
  { name = "httpx" },
@@ -397,9 +397,9 @@ dependencies = [
397
397
  { name = "orjson" },
398
398
  { name = "websockets" },
399
399
  ]
400
- sdist = { url = "https://files.pythonhosted.org/packages/3f/ae/91446c1fffa04a2dc1f81afbfb5bfff3590452891a72bd9098a656ab2657/langgraph_sdk-0.4.4.tar.gz", hash = "sha256:4e651ffa09de695681579396375377bdde23bedbc8e35b070e615cbd5af7da8b", size = 345789, upload-time = "2026-08-27T21:25:22.593Z" }
400
+ sdist = { url = "https://files.pythonhosted.org/packages/64/a8/d5807df5976f2b8e181baddbddf857cc0ba501bba274e81711b10385c65b/langgraph_sdk-0.4.11.tar.gz", hash = "sha256:2550af3bc7cb78ac4facb97d141ec1a76568fa3eb3d29040cff70b45bda84740", size = 366656, upload-time = "2026-10-30T22:17:49.202Z" }
401
401
  wheels = [
402
- { url = "https://files.pythonhosted.org/packages/43/d5/2ad7f3a835c6fcebf58b6669552536ecd52d2dfe4cf49c6c36648fd83572/langgraph_sdk-0.4.4-py3-none-any.whl", hash = "sha256:39afe416c91742925e6f8a93715f566d499b36e1b636b804a4ffe3190e4f4e64", size = 162270, upload-time = "2026-08-27T21:25:21.072Z" },
402
+ { url = "https://files.pythonhosted.org/packages/01/88/69899bb20b96b80468e98b90377e605c36658125e7e7fba401868a86138e/langgraph_sdk-0.4.11-py3-none-any.whl", hash = "sha256:6a65be4a8f825966a07317b8e34e3337cd227b9b58b185f0123fd13c3d0116fa", size = 169311, upload-time = "2026-10-30T22:17:47.96Z" },
403
403
  ]
404
404
 
405
405
  [[package]]