#Copilotkit+ag-ui+sse cause severe disconnection and message loss issues.

1 messages · Page 1 of 1 (latest)

solemn inlet
#

My agent webapp using copilotkit+ag-ui(crewai), about 20% of conversions disconnected when user uses it. This has seriously affected normal use. Some Info:

  1. frontend deployed on vercel and backend deployed on aws
  2. long-term task above 1 min is easy to disconnect
  3. The network is good, when disconnection happened, backend is still running, but frontend disconnected
  4. I checked the source code of copilotkit, seems that you are not following the standard SSE protocol. The frontend only uses fetch to establish a connection with the backend service, but there is no disconnection retry mechanism or other means to ensure that the frontend can receive messages correctly.

How to solve this issue?

raven mulchBOT
#

Hi @solemn inlet ,
Could you please ensure you are using the latest CopilotKit and ag-ui versions.

If the issue continues after updating, it might be worth examining your Vercel deployment configuration for any platform-specific settings related to connection timeouts or proxy configurations that could affect long-lived SSE connections. These platform considerations can sometimes impact connection stability in ways that are independent of the application-level retry logic.
CopilotKit and ag-ui implement built-in retry mechanisms to handle SSE disconnections and prevent message loss. The retry logic is present in both core CopilotKit and ag-ui integrations, including LangGraph connections. During reconnections, application state is preserved to avoid message loss.

Additionally, the following resources may provide helpful insights:

Let me know if you are facing issues, even after trying all these steps.

Learn how to debug errors in CopilotKit with dev console and set up error observability for monitoring services.

Common issues you may encounter when using Copilots.

GitHub

React UI + elegant infrastructure for AI Copilots, AI chatbots, and in-app AI agents. The Agentic last-mile 🪁 - CopilotKit/CopilotKit

solemn inlet
raven mulchBOT
#

Have you checked your deployment config yet? If that doesn't help, we can loop in the team to take a closer look.

snow linden
raven mulchBOT
#

@solemn inlet Did you check the deployment config? are you still facing these issues?

solemn inlet
solemn inlet