AI Response missing in goal disambiguation component
Missing Tool Calls Attribute in Goal Disambiguation Component
Description
An error occurs in the goal disambiguation component when checking for tool calls in the conversation history. Specifically, when the LLM clarity judge response is missing, the code attempts to access a tool_calls
attribute on a HumanMessage
object which doesn't exist.
Location
- File:
duo_workflow_service/components/goal_disambiguation/component.py
- Line: ~267
- Method:
_clarification_required
Error Details
AttributeError: 'HumanMessage' object has no attribute 'tool_calls'
Stack race
Traceback (most recent call last):
File "/app/duo_workflow_service/workflows/abstract_workflow.py", line 144, in _compile_and_run_graph
async for steps in compiled_graph.astream(
File "/opt/venv/duo-workflow-service-9TtSrW0h-py3.11/lib/python3.11/site-packages/langgraph/pregel/__init__.py", line 1856, in astream
async for _ in runner.atick(
File "/opt/venv/duo-workflow-service-9TtSrW0h-py3.11/lib/python3.11/site-packages/langgraph/pregel/runner.py", line 221, in atick
await arun_with_retry(
File "/opt/venv/duo-workflow-service-9TtSrW0h-py3.11/lib/python3.11/site-packages/langgraph/pregel/retry.py", line 118, in arun_with_retry
await task.proc.ainvoke(task.input, config)
File "/opt/venv/duo-workflow-service-9TtSrW0h-py3.11/lib/python3.11/site-packages/langgraph/utils/runnable.py", line 453, in ainvoke
input = await asyncio.create_task(coro, context=context)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/venv/duo-workflow-service-9TtSrW0h-py3.11/lib/python3.11/site-packages/langgraph/utils/runnable.py", line 236, in ainvoke
ret = await asyncio.create_task(coro, context=context)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/venv/duo-workflow-service-9TtSrW0h-py3.11/lib/python3.11/site-packages/langgraph/graph/graph.py", line 116, in _aroute
result = await self.path.ainvoke(value, config)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/venv/duo-workflow-service-9TtSrW0h-py3.11/lib/python3.11/site-packages/langgraph/utils/runnable.py", line 224, in ainvoke
ret = await asyncio.create_task(coro, context=context)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/venv/duo-workflow-service-9TtSrW0h-py3.11/lib/python3.11/site-packages/langchain_core/runnables/config.py", line 588, in run_in_executor
return await asyncio.get_running_loop().run_in_executor(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/concurrent/futures/thread.py", line 58, in run
result = self.fn(*self.args, **self.kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/venv/duo-workflow-service-9TtSrW0h-py3.11/lib/python3.11/site-packages/langchain_core/runnables/config.py", line 579, in wrapper
return func(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^
File "/app/duo_workflow_service/components/goal_disambiguation/component.py", line 267, in _clarification_required
if last_message.tool_calls is None or len(last_message.tool_calls) == 0:
^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/venv/duo-workflow-service-9TtSrW0h-py3.11/lib/python3.11/site-packages/pydantic/main.py", line 856, in __getattr__
raise AttributeError(f'{type(self).__name__!r} object has no attribute {item!r}')
AttributeError: 'HumanMessage' object has no attribute 'tool_calls'
Links
- Sentry Issue: https://new-sentry.gitlab.net/organizations/gitlab/issues/1392044
- LangSmith Trace: https://smith.langchain.com/public/5ed48a5d-8520-4afa-ad23-f216145016bb/r
Description was generated using AI