#Timeout

1 messages · Page 1 of 1 (latest)

lethal remnant
#

I have a long running agent task and I show the status in the frontend (spinning icon for step/state) and I noticed that the UI timed out even though the backend (Langgraph) agent successfully completed processing all the steps.

Is there a way to configure the timeout setting?

Here's the error I received:

[13:02:35.206] ERROR: terminated
component: "remote-actions.remote-lg-action.streamEvents"
endpoint: {
"deploymentUrl": "http://localhost:2024",
"langsmithApiKey": "api_key",
"agents": [
{
"name": "SupervisorAgentGraph",
"description": "Co-Pilot"
}
],
"type": "langgraph-platform"
}
err: {
"type": "TypeError",
"message": "terminated: Body Timeout Error",
"stack":
TypeError: terminated
at Fetch.onAborted (node:internal/deps/undici/undici:11132:53)
at Fetch.emit (node:events:507:28)
at Fetch.terminate (node:internal/deps/undici/undici:10290:14)
at Object.onError (node:internal/deps/undici/undici:11253:38)
at Request.onError (node:internal/deps/undici/undici:2094:31)
at Object.errorRequest (node:internal/deps/undici/undici:1591:17)
at Socket.<anonymous> (node:internal/deps/undici/undici:6319:16)
at Socket.emit (node:events:519:35)
at TCP.<anonymous> (node:net:351:12)
at TCP.callbackTrampoline (node:internal/async_hooks:130:17)
caused by: BodyTimeoutError: Body Timeout Error
at FastTimer.onParserTimeout [as _onTimeout] (node:internal/deps/undici/undici:6253:32)
at Timeout.onTick [as _onTimeout] (node:internal/deps/undici/undici:2210:17)
at listOnTimeout (node:internal/timers:608:17)
at process.processTimers (node:internal/timers:543:7)
}

trim kettleBOT
#

@lethal remnant Yes. CopilotKit Cloud’s proxy automatically terminates idle streaming connections after roughly 60 seconds with no output, which results in a network error in the developer UI. To keep long-running tasks alive, periodically emit a heartbeat or any small dummy event. For production workloads, deploy the agent to a publicly reachable or self-hosted endpoint (for example via LangSmith or the Node-HTTP integration) instead of tunneling from a local machine.

lethal remnant
#

Hi @limpid swallow - thanks for the response and suggestions. It's a reasoning LLM call (with dspy) that's taking time and i'm 'await'ng it in my code so it's blocking until the LLM responds. Any suggestions for how to periodically emit dummy events in this scenario?

trim kettleBOT
lethal remnant
#

Thanks. I do that already - i.e. emit intermediate states to my frontend. That works well. I typically do it this way:

  1. emit step - starting
  2. do step until complete
  3. emit step - completed

When running the step (at #2 above) involves a reasoning LLM, it can [sometimes] take longer depending on what it is reasoning through. I'm trying to mitigate the timeout occurring in this specific instance.

I looked through the examples you shared and the only thing I can see that might help is to group a set of tasks and run it as async in a threadpool. This might get a bit hairy so wondering if there's another option before I go down this path.

I hope this explain better my scenario. Thanks!