langgraph-runtime-inmem 0.37.0.dev1__py3-none-any.whl → 0.37.0.dev2__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.
@@ -11,7 +11,7 @@ from langgraph_runtime_inmem import (
11
11
  store,
12
12
  )
13
13
 
14
- __version__ = "0.37.0.dev1"
14
+ __version__ = "0.37.0.dev2"
15
15
  __all__ = [
16
16
  "ops",
17
17
  "database",
@@ -1303,23 +1303,21 @@ class Threads(Authenticated):
1303
1303
  "updated_at": now,
1304
1304
  "state_updated_at": now,
1305
1305
  "status": status,
1306
- "interrupts": (
1307
- json_loads(
1308
- json_dumpb(
1309
- {
1310
- t["id"]: [_patch_interrupt(i) for i in t["interrupts"]]
1311
- for t in checkpoint["tasks"]
1312
- if t.get("interrupts")
1313
- }
1314
- )
1315
- )
1316
- if checkpoint
1317
- else {}
1318
- ),
1319
1306
  "error": json_loads(json_dumpb(exception)) if exception else None,
1320
1307
  }
1308
+ # Without a checkpoint there is nothing to replace values and interrupts
1309
+ # with, so keep the ones the thread already has.
1321
1310
  if checkpoint is not None:
1322
1311
  update["values"] = json_loads(json_dumpb(checkpoint["values"]))
1312
+ update["interrupts"] = json_loads(
1313
+ json_dumpb(
1314
+ {
1315
+ t["id"]: [_patch_interrupt(i) for i in t["interrupts"]]
1316
+ for t in checkpoint["tasks"]
1317
+ if t.get("interrupts")
1318
+ }
1319
+ )
1320
+ )
1323
1321
  thread.update(update)
1324
1322
  if _using_encryption():
1325
1323
  encrypted_thread = await _encrypt_for_storage(thread, "thread")
@@ -1390,20 +1388,6 @@ class Threads(Authenticated):
1390
1388
  else:
1391
1389
  base_thread_status = "idle"
1392
1390
 
1393
- interrupts = (
1394
- json_loads(
1395
- json_dumpb(
1396
- {
1397
- t["id"]: [_patch_interrupt(i) for i in t["interrupts"]]
1398
- for t in checkpoint["tasks"]
1399
- if t.get("interrupts")
1400
- }
1401
- )
1402
- )
1403
- if checkpoint
1404
- else {}
1405
- )
1406
-
1407
1391
  now = datetime.now(UTC)
1408
1392
 
1409
1393
  if run_status == "rollback":
@@ -1423,12 +1407,23 @@ class Threads(Authenticated):
1423
1407
  update: dict = {
1424
1408
  "updated_at": now,
1425
1409
  "state_updated_at": now,
1426
- "interrupts": interrupts,
1427
1410
  "status": final_thread_status,
1428
1411
  "error": json_loads(json_dumpb(exception)) if exception else None,
1429
1412
  }
1413
+ # Without a checkpoint (a run that ended before writing one, or a
1414
+ # rollback) there is nothing to replace values and interrupts with, so
1415
+ # keep the ones the thread already has.
1430
1416
  if checkpoint is not None:
1431
1417
  update["values"] = json_loads(json_dumpb(checkpoint["values"]))
1418
+ update["interrupts"] = json_loads(
1419
+ json_dumpb(
1420
+ {
1421
+ t["id"]: [_patch_interrupt(i) for i in t["interrupts"]]
1422
+ for t in checkpoint["tasks"]
1423
+ if t.get("interrupts")
1424
+ }
1425
+ )
1426
+ )
1432
1427
  thread.update(update)
1433
1428
  if _using_encryption():
1434
1429
  encrypted_thread = await _encrypt_for_storage(thread, "thread")
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: langgraph-runtime-inmem
3
- Version: 0.37.0.dev1
3
+ Version: 0.37.0.dev2
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
@@ -1,4 +1,4 @@
1
- langgraph_runtime_inmem/__init__.py,sha256=njoF7ntzqj_9gLnIToIP3m0yhQoCfzBS9FR0FHqJcuU,376
1
+ langgraph_runtime_inmem/__init__.py,sha256=8yOmTdzdkmoW7i09-OKWBBWnMJTjDs6aWCvSjhOPgFU,376
2
2
  langgraph_runtime_inmem/_persistence.py,sha256=ZR0jdrZCoofwrx18bLNT4uDXNnicIlMbZeo75ZjYIII,2992
3
3
  langgraph_runtime_inmem/checkpoint.py,sha256=B3FyQTrypz7jmNwH35AG9yPFjwCUL07BHJs7eDWxnRw,12656
4
4
  langgraph_runtime_inmem/database.py,sha256=m31uoLhS18A2jy-kZARBnppecLgJY-8BfX_laGmEoHc,9690
@@ -6,11 +6,11 @@ langgraph_runtime_inmem/encryption.py,sha256=YBYkAjLGF4Yxc2cbpON2q0HkkIfP6hBg0RW
6
6
  langgraph_runtime_inmem/inmem_stream.py,sha256=ZKwPFtSFcQfdDLSIkEBpUXv692YdPpzpcqy5wzJjcUY,9207
7
7
  langgraph_runtime_inmem/lifespan.py,sha256=F93NL8ckeJGe78WhNMeC0ysOchSBym69KwyHIa_yqkY,6736
8
8
  langgraph_runtime_inmem/metrics.py,sha256=vcTTwHsh8AZkOCg1t0f2QvgjWnqxN98YivLVyb4hwVM,420
9
- langgraph_runtime_inmem/ops.py,sha256=i4C49oz5JuhCWb0zseQVFaA16Bd91rgtasVkwUmB_lg,163246
9
+ langgraph_runtime_inmem/ops.py,sha256=NDXdzm1IYw4R-4Z66TPtzy5zgyf-QZ4oXykAg2_jSlA,163380
10
10
  langgraph_runtime_inmem/queue.py,sha256=Ahr1kpzw5N3FKagaB65rzbO0DMLr2Mq-5j02AGh8c-I,15928
11
11
  langgraph_runtime_inmem/retry.py,sha256=XmldOP4e_H5s264CagJRVnQMDFcEJR_dldVR1Hm5XvM,763
12
12
  langgraph_runtime_inmem/routes.py,sha256=QtG9KPForGQHwMZYzl3BRV4Zy1pt0zJxPCX2hO0gaqY,18693
13
13
  langgraph_runtime_inmem/store.py,sha256=ENnW5YCxPRe3PQfiwxmHdBWxhf4FMX09ZWVPMuAlAWk,4179
14
- langgraph_runtime_inmem-0.37.0.dev1.dist-info/METADATA,sha256=AV8oZcYZRJlmdk-C_eWb__E09r7kb7Qfe70-res0SXc,607
15
- langgraph_runtime_inmem-0.37.0.dev1.dist-info/WHEEL,sha256=W3fkpkm7-wf9vBI5Z-7s0eWkeM-spu78I8Neb98DeEg,87
16
- langgraph_runtime_inmem-0.37.0.dev1.dist-info/RECORD,,
14
+ langgraph_runtime_inmem-0.37.0.dev2.dist-info/METADATA,sha256=TLWAGYydHOMgMfccJ2kXxd_uKCbboTg6adrF6vSy8Kg,607
15
+ langgraph_runtime_inmem-0.37.0.dev2.dist-info/WHEEL,sha256=W3fkpkm7-wf9vBI5Z-7s0eWkeM-spu78I8Neb98DeEg,87
16
+ langgraph_runtime_inmem-0.37.0.dev2.dist-info/RECORD,,