langgraph-runtime-inmem 0.37.0.dev4__py3-none-any.whl → 0.37.0.dev5__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.dev4"
14
+ __version__ = "0.37.0.dev5"
15
15
  __all__ = [
16
16
  "ops",
17
17
  "database",
@@ -209,7 +209,8 @@ async def _save_thread_status(
209
209
 
210
210
  def _run_stream_mode_matches(event_mode: str, stream_mode: list[str] | None) -> bool:
211
211
  """Return True if a published run-stream event matches the join filter."""
212
- if not stream_mode:
212
+ # A run's error is its outcome, not a selectable mode, so no filter drops it.
213
+ if not stream_mode or event_mode == "error":
213
214
  return True
214
215
  if event_mode in stream_mode:
215
216
  return True
@@ -3178,15 +3179,19 @@ class Runs(Authenticated):
3178
3179
  data=action.encode(),
3179
3180
  reason=reason,
3180
3181
  )
3181
- coros.append(stream_manager.put(run_id, thread_id, control_message))
3182
+ # Cancels by status or assistant have no thread_id; the worker listens on the run's own.
3183
+ coros.append(stream_manager.put(run_id, run["thread_id"], control_message))
3182
3184
 
3183
- queues = stream_manager.get_queues(run_id, thread_id)
3185
+ queues = stream_manager.get_queues(run_id, run["thread_id"])
3184
3186
 
3185
3187
  if run["status"] in ("pending", "running"):
3186
3188
  cancelable_runs.append(run)
3187
3189
  if run["status"] == "pending":
3188
3190
  pending_thread_ids.add(run["thread_id"])
3189
- if queues or action != "rollback":
3191
+ if action == "rollback" and run["status"] == "running":
3192
+ # Its worker finalizes the rollback; staying "running" holds the thread's next run until then.
3193
+ pass
3194
+ elif queues or action != "rollback":
3190
3195
  run["status"] = "interrupted"
3191
3196
  run["cancel_reason"] = reason
3192
3197
  run["updated_at"] = datetime.now(tz=UTC)
@@ -3194,7 +3199,6 @@ class Runs(Authenticated):
3194
3199
  await logger.ainfo(
3195
3200
  "Eagerly deleting pending run with rollback action",
3196
3201
  run_id=str(run_id),
3197
- status=run["status"],
3198
3202
  )
3199
3203
  coros.append(Runs.delete(conn, run_id, thread_id=run["thread_id"]))
3200
3204
  else:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: langgraph-runtime-inmem
3
- Version: 0.37.0.dev4
3
+ Version: 0.37.0.dev5
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=00BpOJBvNHzNKkjjRKw4OO2e7cwyYPNDQdzup5SJGCA,376
1
+ langgraph_runtime_inmem/__init__.py,sha256=SF8O8d6e3l5YY_UyoalPY6AnmEnKkWQ85A3FCVS44nY,376
2
2
  langgraph_runtime_inmem/_persistence.py,sha256=ZR0jdrZCoofwrx18bLNT4uDXNnicIlMbZeo75ZjYIII,2992
3
3
  langgraph_runtime_inmem/checkpoint.py,sha256=-0RZP74BScWRUEyc9czP07aP2PvVLlQbXUGRakOQIl4,10796
4
4
  langgraph_runtime_inmem/database.py,sha256=U3_VW7ZTIIcXm_WHgtgZllHFComvzzKVAu04kdbEBYc,11788
@@ -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=WyuViqwyCnA3mpIpbRWGmBM0P8OhaXw6rbA_hQmasR0,167867
9
+ langgraph_runtime_inmem/ops.py,sha256=gY6VQ4GaBvylAJoXXzuv3lJC1cr1s3HXG5R-0DZ3DR0,168257
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.dev4.dist-info/METADATA,sha256=ZBwrlTCTbK8gy1c7sv2cHf6hqzS0CaV20KLjG1XFbbg,606
15
- langgraph_runtime_inmem-0.37.0.dev4.dist-info/WHEEL,sha256=W3fkpkm7-wf9vBI5Z-7s0eWkeM-spu78I8Neb98DeEg,87
16
- langgraph_runtime_inmem-0.37.0.dev4.dist-info/RECORD,,
14
+ langgraph_runtime_inmem-0.37.0.dev5.dist-info/METADATA,sha256=dZlATmKdOcxejILWmbAkEaa3fn87PRkMQcPqyFZh6XY,606
15
+ langgraph_runtime_inmem-0.37.0.dev5.dist-info/WHEEL,sha256=W3fkpkm7-wf9vBI5Z-7s0eWkeM-spu78I8Neb98DeEg,87
16
+ langgraph_runtime_inmem-0.37.0.dev5.dist-info/RECORD,,