Dangling tasks detected
pipecat version
0.0.90
Python version
3.11
Operating System
pipecatcloud
Issue description
Hi, I’ve set up an MCP tool using the Pinecone MCP server (assistant) for RAG purposes, and I’ve noticed that during each session, the function call eventually becomes dangling. I’ve also opened a ticket with Pinecone support, as I’m not sure whether the issue originates from Pipecat or from their side.
Reproduction steps
code snippet:
from pipecat.services.mcp_service import MCPClient from pipecat.services.openai.llm import BaseOpenAILLMService from mcp.client.session_group import StreamableHttpParameters from pipecat.processors.aggregators.openai_llm_context import OpenAILLMContext
mcp_client = MCPClient(server_params=StreamableHttpParameters( url=mcp_url, headers={"Authorization": f"Bearer {external_config.get('apiKey')}"} ))
llm = OpenAILLMService(api_key=api_key, params=BaseOpenAILLMService.InputParams(max_completion_tokens=16384)) tools = await mcp_client.register_tools(llm) context = OpenAILLMContext(messages=self.messages, tools=tools)
Expected behavior
I would expect the function to return the result
Actual behavior
Dangling tasks detected: ['OpenAILLMService#0::_run_function_call']
Logs
2025-10-27 07:47:27.668 | WARNING | pipecat.pipeline.task:_print_dangling_tasks:842 | 43b38982-70c3-4479-9a95-f9b26901e3d1 - Dangling tasks detected: ['OpenAILLMService#0::_run_function_call']
nothing returns from:
2025-10-29 10:13:17.258 | DEBUG | pipecat.services.mcp_service:_call_tool:280 | aab7b121-18f3-4ba6-b0bb-421a0b7d5dac - Calling mcp tool 'get_context'
cc @vipyne who has worked with MCP and may have an idea.
@vipyne my hunch is that the MCP call never returns, which is what results in the dangling task when the Pipeline shuts down. Have you seen an occurrences of this in your testing?
@markbackman @vipyne - any update on that ? When talking with pinecone support, they tell me requests are successful on their side thanks for your help
We're looking into MCP now. I did hit this in testing over the weekend, so it might be something in our MCPClient. We'll know soon.
Ok Thanks
Le lun. 3 nov. 2025 à 22:02, Mark Backman @.***> a écrit :
markbackman left a comment (pipecat-ai/pipecat#2938) https://github.com/pipecat-ai/pipecat/issues/2938#issuecomment-3482328426
We're looking into MCP now. I did hit this in testing over the weekend, so it might be something in our MCPClient. We'll know soon.
— Reply to this email directly, view it on GitHub https://github.com/pipecat-ai/pipecat/issues/2938#issuecomment-3482328426, or unsubscribe https://github.com/notifications/unsubscribe-auth/AD3MXBZ3BD54YYJK4OIBTKD326RDZAVCNFSM6AAAAACKUTKLLCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZTIOBSGMZDQNBSGY . You are receiving this because you authored the thread.Message ID: @.***>
Hi @markbackman - just for me to know if I should move from MCP to regular function calls, do you have any estimate on when the issue could be fixed ? Thanks for your help
I'm tagging @vipyne as she's more up to date on MCP things than I am.
@vipyne, @Raphyo is seeing a dangling task when calling an MCP tool. I know you did more testing with MCP this week. Did you see any occurrences of this? And/or did we make any fixes that will remove this occurrence from happening?
@vipyne - any update on that ? Thanks
@vipyne - any update on that ? Thanks
hi @Raphyo,
a few questions:
- does this happen with a different LLM?
- does the
get_contextfunction call sometimes work? like, earlier in the session? - how long does it take for this warning to occur?
- does this warning always occur every session?
- can you post a link to the pinecone MCP server so that I can get api key / mcp_url to try to reproduce this issue?
- can you post a gist of all the logs of the session (or at least the logs from start to the
_print_dangling_tasks)?