TypeError: Interrupt.__init__() got an unexpected keyword argument 'interrupt_id' #829

Closed
opened 2026-02-20 17:41:58 -05:00 by yindo · 7 comments
Owner

Originally created by @ovinix on GitHub (Jul 22, 2025).

Originally assigned to: @sydney-runkle 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

from langgraph.pregel.remote import RemoteGraph

url = URL # url of LangGraph Server
thread_id = THREAD_ID # ID of the thread with a graph run waiting for resume
remote_graph = RemoteGraph("agent", url=url)
config = {"configurable": {"thread_id": thread_id}}

state = await remote_graph.aget_state(config)

Error Message and Stack Trace (if applicable)

File ".venv/lib/python3.13/site-packages/langgraph/pregel/remote.py", line 419, in aget_state
    return self._create_state_snapshot(state)
           ~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^
  File ".venv/lib/python3.13/site-packages/langgraph/pregel/remote.py", line 258, in _create_state_snapshot
    interrupts.append(Interrupt(**interrupt))
                      ~~~~~~~~~^^^^^^^^^^^^^
TypeError: Interrupt.__init__() got an unexpected keyword argument 'interrupt_id'

Description

State for threads with interrupt should be returned correctly using RemoteGraph.

Failing task object:

{
  'id': '91230d61-ca2f-ff91-c768-99020b496456', 
  'name': 'wait_for_response', 
  'path': ['__pregel_pull', 'wait_for_response'], 
  'error': None, 
  'interrupts': [{'interrupt_id': '6abbf7cd8ec27c8ecd98b9e2576580f5', 'value': 'Waiting response from user', 'resumable': True, 'ns': ['wait_for_response:91230d61-ca2f-ff91-c768-99020b496456'], 'when': 'during'}], 
  'checkpoint': None, 
  'state': None, 
  'result': None
}

System Info

System Information

OS: Linux
OS Version: #1 SMP Tue Nov 5 00:21:55 UTC 2024
Python Version: 3.13.2 (main, Feb 25 2025, 14:56:35) [GCC 11.4.0]

Package Information

langchain_core: 0.3.70
langchain: 0.3.26
langchain_community: 0.3.27
langsmith: 0.4.8
langchain_mcp_adapters: 0.1.9
langchain_openai: 0.3.28
langchain_text_splitters: 0.3.8
langgraph_api: 0.2.98
langgraph_cli: 0.3.5
langgraph_license: Installed. No version info available.
langgraph_runtime: Installed. No version info available.
langgraph_runtime_inmem: 0.6.0
langgraph_sdk: 0.1.74

Originally created by @ovinix on GitHub (Jul 22, 2025). Originally assigned to: @sydney-runkle 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 ```python from langgraph.pregel.remote import RemoteGraph url = URL # url of LangGraph Server thread_id = THREAD_ID # ID of the thread with a graph run waiting for resume remote_graph = RemoteGraph("agent", url=url) config = {"configurable": {"thread_id": thread_id}} state = await remote_graph.aget_state(config) ``` ### Error Message and Stack Trace (if applicable) ```shell File ".venv/lib/python3.13/site-packages/langgraph/pregel/remote.py", line 419, in aget_state return self._create_state_snapshot(state) ~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^ File ".venv/lib/python3.13/site-packages/langgraph/pregel/remote.py", line 258, in _create_state_snapshot interrupts.append(Interrupt(**interrupt)) ~~~~~~~~~^^^^^^^^^^^^^ TypeError: Interrupt.__init__() got an unexpected keyword argument 'interrupt_id' ``` ### Description State for threads with interrupt should be returned correctly using RemoteGraph. Failing `task` object: ``` { 'id': '91230d61-ca2f-ff91-c768-99020b496456', 'name': 'wait_for_response', 'path': ['__pregel_pull', 'wait_for_response'], 'error': None, 'interrupts': [{'interrupt_id': '6abbf7cd8ec27c8ecd98b9e2576580f5', 'value': 'Waiting response from user', 'resumable': True, 'ns': ['wait_for_response:91230d61-ca2f-ff91-c768-99020b496456'], 'when': 'during'}], 'checkpoint': None, 'state': None, 'result': None } ``` ### System Info System Information ------------------ > OS: Linux > OS Version: #1 SMP Tue Nov 5 00:21:55 UTC 2024 > Python Version: 3.13.2 (main, Feb 25 2025, 14:56:35) [GCC 11.4.0] Package Information ------------------- > langchain_core: 0.3.70 > langchain: 0.3.26 > langchain_community: 0.3.27 > langsmith: 0.4.8 > langchain_mcp_adapters: 0.1.9 > langchain_openai: 0.3.28 > langchain_text_splitters: 0.3.8 > langgraph_api: 0.2.98 > langgraph_cli: 0.3.5 > langgraph_license: Installed. No version info available. > langgraph_runtime: Installed. No version info available. > langgraph_runtime_inmem: 0.6.0 > langgraph_sdk: 0.1.74
yindo added the bug label 2026-02-20 17:41:58 -05:00
yindo closed this issue 2026-02-20 17:41:58 -05:00
Author
Owner

@sydney-runkle commented on GitHub (Jul 23, 2025):

Can you test this with v0.6.0a1? I think it should be fixed with the new langgraph version.

Thanks!

@sydney-runkle commented on GitHub (Jul 23, 2025): Can you test this with v0.6.0a1? I think it should be fixed with the new langgraph version. Thanks!
Author
Owner

@ovinix commented on GitHub (Jul 24, 2025):

Hi @sydney-runkle

Thanks for your response!

I'd say upgrade to v0.6.0a1 was not smooth and I just received another error.

Here are steps I did:

  1. poetry add langgraph=0.6.0a1 langgraph-sdk=0.2.0 + langgraph dev
    Error in logs:
File ".venv/lib/python3.13/site-packages/langgraph/prebuilt/tool_node.py", line 43, in <module>
    from langgraph.utils.runnable import RunnableCallable
ModuleNotFoundError: No module named 'langgraph.utils'
Could not import python module for graph:
GraphSpec(id='agent', path='agent.py', module=None, variable='graph', config={}, description=None)
This error likely means you haven't installed your project and its dependencies yet. Before running the server, install your project:

If you are using requirements.txt:
python -m pip install -r requirements.txt

If you are using pyproject.toml or setuptools:
python -m pip install -e .

Make sure to run this command from your project's root directory (where your setup.py or pyproject.toml is located)
  1. Manually changed from langgraph.utils.runnable import RunnableCallable to from langgraph._internal._runnable import RunnableCallable in these files:
  • .venv/lib/python3.13/site-packages/langgraph/prebuilt/chat_agent_executor.py
  • .venv/lib/python3.13/site-packages/langgraph/prebuilt/tool_node.py
  • .venv/lib/python3.13/site-packages/langgraph/prebuilt/tool_validator.py
  1. Once graph was in interrupt state await remote_graph.aget_state(config) was executed
    Errors in logs:
File "src/agents_api/test.py", line 44, in call
    state = await remote_graph.aget_state(config)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File ".venv/lib/python3.13/site-packages/langgraph/pregel/remote.py", line 421, in aget_state
    state = await client.threads.get_state(
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    ...<3 lines>...
    )
    ^
  File ".venv/lib/python3.13/site-packages/langgraph_sdk/client.py", line 1366, in get_state
    return await self.http.post(
           ^^^^^^^^^^^^^^^^^^^^^
    ...<3 lines>...
    )
    ^
  File ".venv/lib/python3.13/site-packages/langgraph_sdk/client.py", line 299, in post
    raise e
  File ".venv/lib/python3.13/site-packages/langgraph_sdk/client.py", line 292, in post
    r.raise_for_status()
    ~~~~~~~~~~~~~~~~~~^^
  File ".venv/lib/python3.13/site-packages/httpx/_models.py", line 829, in raise_for_status
    raise HTTPStatusError(message, request=request, response=self)
httpx.HTTPStatusError: Server error '500 Internal Server Error' for url 'http://localhost:2024/threads/073b6554-0811-4953-9978-3df0adc47604/state/checkpoint'
For more information check: https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/500
Internal Server Error

...

 File ".venv/lib/python3.13/site-packages/langgraph_api/api/threads.py", line 86, in get_thread_state
    state = state_snapshot_to_thread_state(
        await Threads.State.get(
            conn, {"configurable": {"thread_id": thread_id}}, subgraphs=subgraphs
        )
    )
  File ".venv/lib/python3.13/site-packages/langgraph_api/state.py", line 69, in state_snapshot_to_thread_state
    state_interrupt_to_thread_interrupt(i) for i in t.interrupts
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^
  File ".venv/lib/python3.13/site-packages/langgraph_api/state.py", line 52, in state_interrupt_to_thread_interrupt
    "resumable": interrupt.resumable,
                 ^^^^^^^^^^^^^^^^^^^
AttributeError: 'Interrupt' object has no attribute 'resumable'
@ovinix commented on GitHub (Jul 24, 2025): Hi @sydney-runkle Thanks for your response! I'd say upgrade to v0.6.0a1 was not smooth and I just received another error. Here are steps I did: 1. `poetry add langgraph=0.6.0a1 langgraph-sdk=0.2.0` + `langgraph dev` Error in logs: ``` File ".venv/lib/python3.13/site-packages/langgraph/prebuilt/tool_node.py", line 43, in <module> from langgraph.utils.runnable import RunnableCallable ModuleNotFoundError: No module named 'langgraph.utils' Could not import python module for graph: GraphSpec(id='agent', path='agent.py', module=None, variable='graph', config={}, description=None) This error likely means you haven't installed your project and its dependencies yet. Before running the server, install your project: If you are using requirements.txt: python -m pip install -r requirements.txt If you are using pyproject.toml or setuptools: python -m pip install -e . Make sure to run this command from your project's root directory (where your setup.py or pyproject.toml is located) ``` 2. Manually changed `from langgraph.utils.runnable import RunnableCallable` to `from langgraph._internal._runnable import RunnableCallable` in these files: - `.venv/lib/python3.13/site-packages/langgraph/prebuilt/chat_agent_executor.py` - `.venv/lib/python3.13/site-packages/langgraph/prebuilt/tool_node.py` - `.venv/lib/python3.13/site-packages/langgraph/prebuilt/tool_validator.py` 3. Once graph was in interrupt state `await remote_graph.aget_state(config)` was executed Errors in logs: ``` File "src/agents_api/test.py", line 44, in call state = await remote_graph.aget_state(config) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File ".venv/lib/python3.13/site-packages/langgraph/pregel/remote.py", line 421, in aget_state state = await client.threads.get_state( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ...<3 lines>... ) ^ File ".venv/lib/python3.13/site-packages/langgraph_sdk/client.py", line 1366, in get_state return await self.http.post( ^^^^^^^^^^^^^^^^^^^^^ ...<3 lines>... ) ^ File ".venv/lib/python3.13/site-packages/langgraph_sdk/client.py", line 299, in post raise e File ".venv/lib/python3.13/site-packages/langgraph_sdk/client.py", line 292, in post r.raise_for_status() ~~~~~~~~~~~~~~~~~~^^ File ".venv/lib/python3.13/site-packages/httpx/_models.py", line 829, in raise_for_status raise HTTPStatusError(message, request=request, response=self) httpx.HTTPStatusError: Server error '500 Internal Server Error' for url 'http://localhost:2024/threads/073b6554-0811-4953-9978-3df0adc47604/state/checkpoint' For more information check: https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/500 Internal Server Error ``` ... ``` File ".venv/lib/python3.13/site-packages/langgraph_api/api/threads.py", line 86, in get_thread_state state = state_snapshot_to_thread_state( await Threads.State.get( conn, {"configurable": {"thread_id": thread_id}}, subgraphs=subgraphs ) ) File ".venv/lib/python3.13/site-packages/langgraph_api/state.py", line 69, in state_snapshot_to_thread_state state_interrupt_to_thread_interrupt(i) for i in t.interrupts ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^ File ".venv/lib/python3.13/site-packages/langgraph_api/state.py", line 52, in state_interrupt_to_thread_interrupt "resumable": interrupt.resumable, ^^^^^^^^^^^^^^^^^^^ AttributeError: 'Interrupt' object has no attribute 'resumable' ```
Author
Owner

@sydney-runkle commented on GitHub (Jul 24, 2025):

Gotcha, fixes in the works for both of those. We'll get this fixed by the end of the week, thanks for the report.

@sydney-runkle commented on GitHub (Jul 24, 2025): Gotcha, fixes in the works for both of those. We'll get this fixed by the end of the week, thanks for the report.
Author
Owner

@farouk09 commented on GitHub (Jul 24, 2025):

@sydney-runkle I'm encountering an issue similar to the one mentioned.

When I call a remote graph for the first time using a new thread ID, everything works as expected:

remote_graph = RemoteGraph(graph_name, sync_client=sync_client)

# create a new thread
thread = sync_client.threads.create()
print(thread['thread_id'])

# invoke the graph
config = {"configurable": {"thread_id": thread['thread_id']}}
result = remote_graph.invoke({
    "messages": [{"role": "user", "content": "hello, my name is Farouk"}]
}, config=config)

print(result)

This produces a valid response:

9cf3b9c1-6746-48e0-b2a2-8c31ac9de524

{'messages': [
    {'content': 'hello, my name is Farouk', ...},
    {'content': "Hello Farouk, nice to meet you! ...", ...}
]}

However, when I try to reuse the same thread ID in a second call:

config = {"configurable": {"thread_id": "9cf3b9c1-6746-48e0-b2a2-8c31ac9de524"}}
result = remote_graph.invoke({
    "messages": [{"role": "user", "content": "what is my name?"}]
}, config=config)

I get this error:

Traceback (most recent call last):
  File "/home/aptikal/abdalfar/InterviewSim/livekit_server/example/test.py", line 48, in <module>
    result = remote_graph.invoke({
        "messages": [{"role": "user", "content": "hello, my name is farouk "}]
    }, config=config)
  File "/home/aptikal/abdalfar/InterviewSim/livekit_server/.venv/lib/python3.13/site-packages/langgraph/pregel/remote.py", line 856, in invoke
    for chunk in self.stream(
                 ~~~~~~~~~~~^
        input,
        ^^^^^^
    ...<4 lines>...
        **kwargs,
        ^^^^^^^^^
    ):
    ^
  File "/home/aptikal/abdalfar/InterviewSim/livekit_server/.venv/lib/python3.13/site-packages/langgraph/pregel/remote.py", line 693, in stream
    raise RemoteException(chunk.data)
langgraph.pregel.remote.RemoteException: {'error': 'TypeError', 'message': "int() argument must be a string, a bytes-like object or a real number, not 'HumanMessage'"}

It seems like something goes wrong when reusing the thread. Do you know what could be causing this?

@farouk09 commented on GitHub (Jul 24, 2025): @sydney-runkle I'm encountering an issue similar to the one mentioned. When I call a remote graph for the first time using a new thread ID, everything works as expected: ``` remote_graph = RemoteGraph(graph_name, sync_client=sync_client) # create a new thread thread = sync_client.threads.create() print(thread['thread_id']) # invoke the graph config = {"configurable": {"thread_id": thread['thread_id']}} result = remote_graph.invoke({ "messages": [{"role": "user", "content": "hello, my name is Farouk"}] }, config=config) print(result) ``` This produces a valid response: ``` 9cf3b9c1-6746-48e0-b2a2-8c31ac9de524 {'messages': [ {'content': 'hello, my name is Farouk', ...}, {'content': "Hello Farouk, nice to meet you! ...", ...} ]} ``` However, when I try to reuse the same thread ID in a second call: ``` config = {"configurable": {"thread_id": "9cf3b9c1-6746-48e0-b2a2-8c31ac9de524"}} result = remote_graph.invoke({ "messages": [{"role": "user", "content": "what is my name?"}] }, config=config) ``` I get this error: ``` Traceback (most recent call last): File "/home/aptikal/abdalfar/InterviewSim/livekit_server/example/test.py", line 48, in <module> result = remote_graph.invoke({ "messages": [{"role": "user", "content": "hello, my name is farouk "}] }, config=config) File "/home/aptikal/abdalfar/InterviewSim/livekit_server/.venv/lib/python3.13/site-packages/langgraph/pregel/remote.py", line 856, in invoke for chunk in self.stream( ~~~~~~~~~~~^ input, ^^^^^^ ...<4 lines>... **kwargs, ^^^^^^^^^ ): ^ File "/home/aptikal/abdalfar/InterviewSim/livekit_server/.venv/lib/python3.13/site-packages/langgraph/pregel/remote.py", line 693, in stream raise RemoteException(chunk.data) langgraph.pregel.remote.RemoteException: {'error': 'TypeError', 'message': "int() argument must be a string, a bytes-like object or a real number, not 'HumanMessage'"} ``` It seems like something goes wrong when reusing the thread. Do you know what could be causing this?
Author
Owner

@sydney-runkle commented on GitHub (Jul 25, 2025):

Hiya, just released v0.6.0a2. Could you please test with that? Thanks so much!

@sydney-runkle commented on GitHub (Jul 25, 2025): Hiya, just released v0.6.0a2. Could you please test with that? Thanks so much!
Author
Owner

@farouk09 commented on GitHub (Jul 25, 2025):

@sydney-runkle edit :sorry for the inconvenience, the bug was in my code.

@farouk09 commented on GitHub (Jul 25, 2025): @sydney-runkle edit :sorry for the inconvenience, the bug was in my code.
Author
Owner

@sydney-runkle commented on GitHub (Aug 5, 2025):

No worries!

@sydney-runkle commented on GitHub (Aug 5, 2025): No worries!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langchain-ai/langgraph#829