Skip to content

[pull] main from danny-avila:main#124

Merged
pull[bot] merged 2 commits into
innFactory:mainfrom
danny-avila:main
Jun 25, 2026
Merged

[pull] main from danny-avila:main#124
pull[bot] merged 2 commits into
innFactory:mainfrom
danny-avila:main

Conversation

@pull

@pull pull Bot commented Jun 25, 2026

Copy link
Copy Markdown

See Commits and Changes for more details.


Created by pull[bot] (v2.0.0-alpha.4)

Can you help keep this open source service alive? 💖 Please sponsor : )

* feat(run): default durability to 'exit' when a checkpointer is active

Runs that attach a checkpointer (the HITL MemorySaver fallback or a
host-supplied saver) only need to persist at the graph's exit/interrupt
boundary, not after every superstep. processStream now defaults
`durability: 'exit'` whenever a checkpointer is present, so normal runs
skip per-superstep checkpoint writes. An explicit caller `durability`
still wins, and runs without a checkpointer keep langgraph's default.

Extract the repeated processStream/resume config shape into
`RunStreamConfig` and add the optional `durability` field (local
`Durability` union, since langgraph does not export it from the root).

Coverage: unit tests for the default / explicit-override / no-checkpointer
cases, plus a mongodb-memory-server integration test (real Run + fake
streaming model + official MongoDBSaver) proving the default writes one
checkpoint document versus more than one under an async override.

* fix(run): address Codex review on durability default

- Detect the checkpointer at graph-creation time via a `hasCheckpointer`
  flag instead of reading `Graph.compileOptions` in processStream. For a
  standard graph with HITL enabled and caller compileOptions that omit a
  checkpointer, the constructor restores the raw caller options onto
  Graph.compileOptions and drops the fallback MemorySaver from that
  metadata, so the old check missed it and that HITL run kept langgraph's
  per-superstep default. Captured before the overwrite, the flag is correct.
- Expose `durability` on AgentSessionRunOptions.config so session consumers
  can pass an object-literal override without a cast.
- Move the mongodb-memory-server spec to durability-checkpoint.integration.test.ts
  (excluded from the unit shards, which avoids a mongod binary download in
  the default suite) and run it via a change-gated step in the integration
  job so coverage is preserved.

Adds a HITL-fallback regression test for the first fix.

* fix(deps): bump langgraph to 1.4.6, use mongodb-memory-server-core

- Bump @langchain/langgraph to 1.4.6, which emits valid UUIDs for exit-mode
  delta task_ids (1.4.5 produced a 6-segment string that Postgres /
  LangGraph API checkpointers reject for the `checkpoint_writes.task_id`
  uuid column). Since this PR makes `durability: 'exit'` the default
  whenever a checkpointer is present, pin the patched version so a
  host-supplied Postgres saver with delta channels is not broken by it.
- Switch the integration-test devDep from mongodb-memory-server to
  mongodb-memory-server-core, which has no postinstall binary download, so
  `npm ci` no longer fetches a mongod binary on every cache miss. The
  binary downloads lazily only when the gated integration test runs.

* test(durability): assert the full storage optimization, not just doc count

Strengthen the Mongo integration test to lock in the optimization end to end:

- Normal run (real Run + fake model): assert exit writes exactly one
  checkpoint and zero per-superstep write docs, while async writes strictly
  more of both collections.
- HITL interrupt (langgraph graph + real saver): assert exit checkpoints
  only at the interrupt boundary (one at pause, two once resumed) while
  async checkpoints every superstep and writes strictly more.

* test(durability): cover multiple sequential interrupts under exit

Adds a regression test for back-to-back ask-user-question rounds: each
interrupt writes its own checkpoint at the boundary, the chain grows
(1 -> 2 -> 3) rather than overwriting, both answers are applied, and the
run resumes correctly each time. Confirms exit durability never discards a
checkpoint the thread still needs across multiple interrupts.
@pull pull Bot locked and limited conversation to collaborators Jun 25, 2026
@pull pull Bot added the ⤵️ pull label Jun 25, 2026
@pull pull Bot merged commit 6c88db9 into innFactory:main Jun 25, 2026
2 checks passed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant