Read checkpoint_pending_writes (in class PregelLoop) from Redis(use langgraph-checkpoint-redis) #1041

Closed
opened 2026-02-20 17:42:51 -05:00 by yindo · 1 comment
Owner

Originally created by @galain1994 on GitHub (Nov 4, 2025).

Originally assigned to: @eyurtsev on GitHub.

Checked other resources

  • This is a bug, not a usage question. For questions, please use the LangChain Forum (https://forum.langchain.com/).
  • I added a clear and detailed title that summarizes the issue.
  • I read what a minimal reproducible example is (https://stackoverflow.com/help/minimal-reproducible-example).
  • I included a self-contained, minimal example that demonstrates the issue INCLUDING all the relevant imports. The code run AS IS to reproduce the issue.

Example Code

human-in-the-loop node

from langgraph.types import interrupt


async def human_selection_node(state: State, runtime: Runtime[ContextSchema]) -> Dict:

    interrupt_message = "Please input your choice"

    user_selection = interrupt(
        interrupt_message
    )
    print(f"user_selection: {user_selection}")

    return {
        "user_selection": user_selection
    }


Agent using redis as checkpointer:


from langgraph.checkpoint.redis.ashallow import AsyncShallowRedisSaver

async with AsyncShallowRedisSaver(REDIS_URL) as checkpointer:
    await checkpointer.asetup()
    agent = compiled_graph.compile(
        checkpointer=checkpointer,
    )

Error Message and Stack Trace (if applicable)

16:24:24 src.handler ERROR   Traceback (most recent call last):
  File "/Users/user/work/code/agent/src/handler.py", line 69, in gen_astream_response
    msg_mode, output = await asyncio.wait_for(stream_generator.__anext__(), timeout=timeout)
                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/python@3.13/3.13.5/Frameworks/Python.framework/Versions/3.13/lib/python3.13/asyncio/tasks.py", line 507, in wait_for
    return await fut
           ^^^^^^^^^
  File "/Users/user/work/code/agent/.venv/lib/python3.13/site-packages/langgraph/pregel/main.py", line 2917, in astream
    async with AsyncPregelLoop(
               ~~~~~~~~~~~~~~~^
        input,
        ^^^^^^
    ...<17 lines>...
        cache_policy=self.cache_policy,
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    ) as loop:
    ^
  File "/Users/user/work/code/agent/.venv/lib/python3.13/site-packages/langgraph/pregel/_loop.py", line 1299, in __aenter__
        input_keys=self.input_keys,
                            ^^^^^^^
    ...<4 lines>...
    
    
  File "/Users/user/work/code/agent/.venv/lib/python3.13/site-packages/langgraph/pregel/_loop.py", line 656, in _first
    raise RuntimeError(
       ^^^^^^^^^^^^^^^^
  File "/Users/user/work/code/agent/.venv/lib/python3.13/site-packages/langgraph/pregel/_loop.py", line 603, in _pending_interrupts
    elif write_type == RESUME:
    
AttributeError: 'dict' object has no attribute 'id'

Description

current langgraph version is 1.0.2, the interrupt works in version 0.5.4.
In version 1.0.2, in file langgraph/pregel/_loop.py:603,
task_id is get from attribute:
pending_interrupts[task_id] = value[0].id
And in version 0.5.4, the "id" in get from dictionary, which is compatible the data stored in redis.

langgraph-checkpoint-redis version is 0.1.2, the intterupt checkpoint data store in redis:
{ "thread_id": "3fa85f64-5717-4562-b3fc-2c963f66afb3", "checkpoint_ns": "", "checkpoint_id": "1f0b9579-a113-633c-8025-bc2dbb26ef87", "task_id": "29cc4ae0-2b5f-c415-e3bb-3ca250d6afb6", "task_path": "~__pregel_pull, HUMAN_SELECTION_NODE", "idx": -3, "channel": "__interrupt__", "type": "json", "blob": "[{"value": [{"sequence_selection": {"type": "string", "title": "Select download sequence", "description": "Select download sequence", "format": "radio", "required": true, "default": null, "enum": [{"schema": "esummary.gene", "ncbi_id": "7157", "Id": "7157", "Name": "TP53", "Description": "tumor protein p53", "Summary": "This gene encodes a tumor suppressor protein containing transcriptional activation, DNA binding, and oligomerization domains. The encoded protein responds to diverse cellular stresses to regulate expression of target genes, thereby inducing cell cycle arrest, apoptosis, senescence, DNA repair, or changes in metabolism. Mutations in this gene are associated with a variety of human cancers, including hereditary cancers such as Li-Fraumeni syndrome. Alternative splicing of this gene and the use of alternate promoters result in multiple transcript variants and isoforms. Additional isoforms have also been shown to result from the use of alternate translation initiation codons from identical transcript variants (PMIDs: 12032546, 20937277). [provided by RefSeq, Dec 2016]", "OtherAliases": "BCC7, BMFS5, LFS1, P53, TRP53", "OrganismScientificName": "Homo sapiens", "OrganismTaxID": "9606", "ChrAccVer": "NC_000017.11", "ChrStart": "7687489", "ChrStop": "7668420", "NomenclatureSymbol": "TP53", "NomenclatureName": "tumor protein p53", "download_type": "ncbi"}], "enumLabels": ["Unknown label"], "items": {"type": "string"}}}], "id": "b30bee2c3a26d9b44523f0434a29e49f"}]" }

System Info

System Information

OS: Darwin
OS Version: Darwin Kernel Version 25.0.0: Wed Sep 17 21:41:45 PDT 2025; root:xnu-12377.1.9~141/RELEASE_ARM64_T6000
Python Version: 3.13.5 (main, Jun 11 2025, 15:36:57) [Clang 17.0.0 (clang-1700.0.13.3)]

Package Information

langchain_core: 1.0.3
langchain_community: 0.4.1
langsmith: 0.4.40
langchain_classic: 1.0.0
langchain_openai: 1.0.2
langchain_text_splitters: 1.0.0
langgraph_api: 0.4.48
langgraph_runtime_inmem: 0.14.1
langgraph_sdk: 0.2.9

Optional packages not installed

langserve

Other Dependencies

aiohttp: 3.13.2
async-timeout: Installed. No version info available.
blockbuster: 1.5.25
claude-agent-sdk: Installed. No version info available.
cloudpickle: 3.1.2
cryptography: 44.0.3
dataclasses-json: 0.6.7
grpcio: 1.76.0
grpcio-tools: 1.75.1
httpx: 0.28.1
httpx-sse: 0.4.3
jsonpatch: 1.33
jsonschema-rs: 0.29.1
langchain-anthropic: Installed. No version info available.
langchain-aws: Installed. No version info available.
langchain-deepseek: Installed. No version info available.
langchain-fireworks: Installed. No version info available.
langchain-google-genai: Installed. No version info available.
langchain-google-vertexai: Installed. No version info available.
langchain-groq: Installed. No version info available.
langchain-mistralai: Installed. No version info available.
langchain-ollama: Installed. No version info available.
langchain-perplexity: Installed. No version info available.
langchain-together: Installed. No version info available.
langchain-xai: Installed. No version info available.
langgraph: 1.0.2
langgraph-checkpoint: 2.1.2
langsmith-pyo3: Installed. No version info available.
numpy: 2.3.4
openai: 2.7.0
openai-agents: Installed. No version info available.
opentelemetry-api: 1.38.0
opentelemetry-exporter-otlp-proto-http: 1.38.0
opentelemetry-sdk: 1.38.0
orjson: 3.11.4
packaging: 25.0
protobuf: 6.33.0
pydantic: 2.12.3
pydantic-settings: 2.11.0
pyjwt: 2.10.1
pytest: 8.4.2
PyYAML: 6.0.3
pyyaml: 6.0.3
requests: 2.32.5
requests-toolbelt: 1.0.0
rich: 14.2.0
SQLAlchemy: 2.0.44
sqlalchemy: 2.0.44
sse-starlette: 2.1.3
starlette: 0.49.3
structlog: 25.5.0
tenacity: 9.1.2
tiktoken: 0.12.0
truststore: 0.10.4
typing-extensions: 4.15.0
uvicorn: 0.38.0
vcrpy: Installed. No version info available.
watchfiles: 1.1.1
zstandard: 0.25.0

Originally created by @galain1994 on GitHub (Nov 4, 2025). Originally assigned to: @eyurtsev on GitHub. ### Checked other resources - [x] This is a bug, not a usage question. For questions, please use the LangChain Forum (https://forum.langchain.com/). - [x] I added a clear and detailed title that summarizes the issue. - [x] I read what a minimal reproducible example is (https://stackoverflow.com/help/minimal-reproducible-example). - [x] I included a self-contained, minimal example that demonstrates the issue INCLUDING all the relevant imports. The code run AS IS to reproduce the issue. ### Example Code human-in-the-loop node ```python from langgraph.types import interrupt async def human_selection_node(state: State, runtime: Runtime[ContextSchema]) -> Dict: interrupt_message = "Please input your choice" user_selection = interrupt( interrupt_message ) print(f"user_selection: {user_selection}") return { "user_selection": user_selection } ``` Agent using redis as checkpointer: ```python from langgraph.checkpoint.redis.ashallow import AsyncShallowRedisSaver async with AsyncShallowRedisSaver(REDIS_URL) as checkpointer: await checkpointer.asetup() agent = compiled_graph.compile( checkpointer=checkpointer, ) ``` ### Error Message and Stack Trace (if applicable) ```shell 16:24:24 src.handler ERROR Traceback (most recent call last): File "/Users/user/work/code/agent/src/handler.py", line 69, in gen_astream_response msg_mode, output = await asyncio.wait_for(stream_generator.__anext__(), timeout=timeout) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/homebrew/Cellar/python@3.13/3.13.5/Frameworks/Python.framework/Versions/3.13/lib/python3.13/asyncio/tasks.py", line 507, in wait_for return await fut ^^^^^^^^^ File "/Users/user/work/code/agent/.venv/lib/python3.13/site-packages/langgraph/pregel/main.py", line 2917, in astream async with AsyncPregelLoop( ~~~~~~~~~~~~~~~^ input, ^^^^^^ ...<17 lines>... cache_policy=self.cache_policy, ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ) as loop: ^ File "/Users/user/work/code/agent/.venv/lib/python3.13/site-packages/langgraph/pregel/_loop.py", line 1299, in __aenter__ input_keys=self.input_keys, ^^^^^^^ ...<4 lines>... File "/Users/user/work/code/agent/.venv/lib/python3.13/site-packages/langgraph/pregel/_loop.py", line 656, in _first raise RuntimeError( ^^^^^^^^^^^^^^^^ File "/Users/user/work/code/agent/.venv/lib/python3.13/site-packages/langgraph/pregel/_loop.py", line 603, in _pending_interrupts elif write_type == RESUME: AttributeError: 'dict' object has no attribute 'id' ``` ### Description current langgraph version is 1.0.2, the interrupt works in version 0.5.4. In version 1.0.2, in file langgraph/pregel/_loop.py:603, task_id is get from attribute: `pending_interrupts[task_id] = value[0].id` And in version 0.5.4, the "id" in get from dictionary, which is compatible the data stored in redis. langgraph-checkpoint-redis version is 0.1.2, the intterupt checkpoint data store in redis: `{ "thread_id": "3fa85f64-5717-4562-b3fc-2c963f66afb3", "checkpoint_ns": "", "checkpoint_id": "1f0b9579-a113-633c-8025-bc2dbb26ef87", "task_id": "29cc4ae0-2b5f-c415-e3bb-3ca250d6afb6", "task_path": "~__pregel_pull, HUMAN_SELECTION_NODE", "idx": -3, "channel": "__interrupt__", "type": "json", "blob": "[{"value": [{"sequence_selection": {"type": "string", "title": "Select download sequence", "description": "Select download sequence", "format": "radio", "required": true, "default": null, "enum": [{"schema": "esummary.gene", "ncbi_id": "7157", "Id": "7157", "Name": "TP53", "Description": "tumor protein p53", "Summary": "This gene encodes a tumor suppressor protein containing transcriptional activation, DNA binding, and oligomerization domains. The encoded protein responds to diverse cellular stresses to regulate expression of target genes, thereby inducing cell cycle arrest, apoptosis, senescence, DNA repair, or changes in metabolism. Mutations in this gene are associated with a variety of human cancers, including hereditary cancers such as Li-Fraumeni syndrome. Alternative splicing of this gene and the use of alternate promoters result in multiple transcript variants and isoforms. Additional isoforms have also been shown to result from the use of alternate translation initiation codons from identical transcript variants (PMIDs: 12032546, 20937277). [provided by RefSeq, Dec 2016]", "OtherAliases": "BCC7, BMFS5, LFS1, P53, TRP53", "OrganismScientificName": "Homo sapiens", "OrganismTaxID": "9606", "ChrAccVer": "NC_000017.11", "ChrStart": "7687489", "ChrStop": "7668420", "NomenclatureSymbol": "TP53", "NomenclatureName": "tumor protein p53", "download_type": "ncbi"}], "enumLabels": ["Unknown label"], "items": {"type": "string"}}}], "id": "b30bee2c3a26d9b44523f0434a29e49f"}]" }` ### System Info System Information ------------------ > OS: Darwin > OS Version: Darwin Kernel Version 25.0.0: Wed Sep 17 21:41:45 PDT 2025; root:xnu-12377.1.9~141/RELEASE_ARM64_T6000 > Python Version: 3.13.5 (main, Jun 11 2025, 15:36:57) [Clang 17.0.0 (clang-1700.0.13.3)] Package Information ------------------- > langchain_core: 1.0.3 > langchain_community: 0.4.1 > langsmith: 0.4.40 > langchain_classic: 1.0.0 > langchain_openai: 1.0.2 > langchain_text_splitters: 1.0.0 > langgraph_api: 0.4.48 > langgraph_runtime_inmem: 0.14.1 > langgraph_sdk: 0.2.9 Optional packages not installed ------------------------------- > langserve Other Dependencies ------------------ > aiohttp: 3.13.2 > async-timeout: Installed. No version info available. > blockbuster: 1.5.25 > claude-agent-sdk: Installed. No version info available. > cloudpickle: 3.1.2 > cryptography: 44.0.3 > dataclasses-json: 0.6.7 > grpcio: 1.76.0 > grpcio-tools: 1.75.1 > httpx: 0.28.1 > httpx-sse: 0.4.3 > jsonpatch: 1.33 > jsonschema-rs: 0.29.1 > langchain-anthropic: Installed. No version info available. > langchain-aws: Installed. No version info available. > langchain-deepseek: Installed. No version info available. > langchain-fireworks: Installed. No version info available. > langchain-google-genai: Installed. No version info available. > langchain-google-vertexai: Installed. No version info available. > langchain-groq: Installed. No version info available. > langchain-mistralai: Installed. No version info available. > langchain-ollama: Installed. No version info available. > langchain-perplexity: Installed. No version info available. > langchain-together: Installed. No version info available. > langchain-xai: Installed. No version info available. > langgraph: 1.0.2 > langgraph-checkpoint: 2.1.2 > langsmith-pyo3: Installed. No version info available. > numpy: 2.3.4 > openai: 2.7.0 > openai-agents: Installed. No version info available. > opentelemetry-api: 1.38.0 > opentelemetry-exporter-otlp-proto-http: 1.38.0 > opentelemetry-sdk: 1.38.0 > orjson: 3.11.4 > packaging: 25.0 > protobuf: 6.33.0 > pydantic: 2.12.3 > pydantic-settings: 2.11.0 > pyjwt: 2.10.1 > pytest: 8.4.2 > PyYAML: 6.0.3 > pyyaml: 6.0.3 > requests: 2.32.5 > requests-toolbelt: 1.0.0 > rich: 14.2.0 > SQLAlchemy: 2.0.44 > sqlalchemy: 2.0.44 > sse-starlette: 2.1.3 > starlette: 0.49.3 > structlog: 25.5.0 > tenacity: 9.1.2 > tiktoken: 0.12.0 > truststore: 0.10.4 > typing-extensions: 4.15.0 > uvicorn: 0.38.0 > vcrpy: Installed. No version info available. > watchfiles: 1.1.1 > zstandard: 0.25.0
yindo added the bugpendingnot maintained by langchain labels 2026-02-20 17:42:51 -05:00
yindo closed this issue 2026-02-20 17:42:51 -05:00
Author
Owner

@eyurtsev commented on GitHub (Nov 7, 2025):

Hi @galain1994 , the redis implementation for the checkpointer is maintained here: https://github.com/redis-developer/langgraph-redis

Could you file an issue at this repository?

@eyurtsev commented on GitHub (Nov 7, 2025): Hi @galain1994 , the redis implementation for the checkpointer is maintained here: https://github.com/redis-developer/langgraph-redis Could you file an issue at this repository?
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langchain-ai/langgraph#1041