pipecat icon indicating copy to clipboard operation
pipecat copied to clipboard

Dangling tasks detected

Open Raphyo opened this issue 2 months ago • 8 comments

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'

Raphyo avatar Oct 30 '25 09:10 Raphyo

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 avatar Oct 30 '25 19:10 markbackman

@markbackman @vipyne - any update on that ? When talking with pinecone support, they tell me requests are successful on their side thanks for your help

Raphyo avatar Nov 03 '25 17:11 Raphyo

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.

markbackman avatar Nov 03 '25 20:11 markbackman

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: @.***>

Raphyo avatar Nov 04 '25 07:11 Raphyo

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

Raphyo avatar Nov 06 '25 09:11 Raphyo

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?

markbackman avatar Nov 06 '25 21:11 markbackman

@vipyne - any update on that ? Thanks

Raphyo avatar Nov 16 '25 19:11 Raphyo

@vipyne - any update on that ? Thanks

hi @Raphyo,

a few questions:

  1. does this happen with a different LLM?
  2. does the get_context function call sometimes work? like, earlier in the session?
  3. how long does it take for this warning to occur?
  4. does this warning always occur every session?
  5. 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?
  6. can you post a gist of all the logs of the session (or at least the logs from start to the _print_dangling_tasks)?

vipyne avatar Nov 19 '25 00:11 vipyne