Skip to content

[bug] Langgraph error AssertionError: expected list, found <class 'NoneType'> #2478

@ionmincu

Description

@ionmincu

Describe the bug
Error logs in agent.

Traceback (most recent call last):
  File "/tmp/company-research-agent/0.0.3/.venv/lib/python3.11/site-packages/openinference/instrumentation/langchain/_tracer.py", line 327, in wrapper
    yield from wrapped(*args, **kwargs)
  File "/tmp/company-research-agent/0.0.3/.venv/lib/python3.11/site-packages/openinference/instrumentation/langchain/_tracer.py", line 577, in _extract_message_role
    assert isinstance(id_, List), f"expected list, found {type(id_)}"
           ^^^^^^^^^^^^^^^^^^^^^
AssertionError: expected list, found <class 'NoneType'>

To Reproduce

Just use the create_agent method from langgraph and invoke the agent with any prompts.

from langchain.agents import create_agent

agent = create_agent(llm, tools=[search_tool], prompt=SYSTEM_PROMPT)

With the following dependencies.

langchain==1.1.0
langchain-classic==1.0.0
langchain-community==0.4.1
langchain-core==1.1.0
langchain-openai==1.1.0
langchain-text-splitters==1.0.0
langgraph==1.0.3
langgraph-checkpoint==3.0.1
langgraph-checkpoint-sqlite==3.0.0
langgraph-prebuilt==1.0.5
langgraph-sdk==0.2.10
openinference-instrumentation==0.1.42
openinference-instrumentation-langchain==0.1.55
openinference-semantic-conventions==0.1.25

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Status

    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions