Chat Agent – Tool Execution Failure ("Downstream tool request failed")

Certified Senior Developer

Hi Team,

Our chat agent is intermittently failing when attempting to execute tool calls. End users are receiving one of the following error messages during these interactions:

  • Tool execution failed: Downstream tool request failed
  • I'm currently experiencing a system issue retrieving the data.

  Discussion posts and replies are publicly visible

  • 0
    Certified Associate Developer

    Review Appian's integration logs (tomcat-stdOut.log or the specific integration error logs in the Monitoring view) for HTTP 429 Too Many Requests errors that correlate with the exact timestamps.

  • 0
    Certified Senior Developer
    in reply to kapilsharma

    Hi Kapil,

    When i checked the log, this is the error message we are getting.

    OkHttp ai-platform.ai-platform.svc.cluster.local/...] ERROR com.appiancorp.lcpapi.streaming.StepStreamingEventSourceListener - Upstream SSE stream failed for run
    java.net.SocketException: Socket closed
    at java.base/sun.nio.ch.NioSocketImpl.ensureOpenAndConnected(NioSocketImpl.java:165)
    at java.base/sun.nio.ch.NioSocketImpl.beginRead(NioSocketImpl.java:236)
    at java.base/sun.nio.ch.NioSocketImpl.implRead(NioSocketImpl.java:304)
    at java.base/sun.nio.ch.NioSocketImpl.read(NioSocketImpl.java:355)
    at java.base/sun.nio.ch.NioSocketImpl$1.read(NioSocketImpl.java:808)
    at java.base/java.net.Socket$SocketInputStream.read(Socket.java:966)
    at okio.InputStreamSource.read(JvmOkio.kt:93)
    at okio.AsyncTimeout$source$1.read(AsyncTimeout.kt:128)
    at okio.RealBufferedSource.request(RealBufferedSource.kt:209)
    at okio.RealBufferedSource.require(RealBufferedSource.kt:202)
    at okio.RealBufferedSource.readHexadecimalUnsignedLong(RealBufferedSource.kt:384)
    at okhttp3.internal.http1.Http1ExchangeCodec$ChunkedSource.readChunkSize(Http1ExchangeCodec.kt:437)
    at okhttp3.internal.http1.Http1ExchangeCodec$ChunkedSource.read(Http1ExchangeCodec.kt:416)
    at okhttp3.internal.connection.Exchange$ResponseBodySource.read(Exchange.kt:281)
    at okio.RealBufferedSource.select(RealBufferedSource.kt:232)
    at okhttp3.internal.sse.ServerSentEventReader.processNextEvent(ServerSentEventReader.kt:50)
    at okhttp3.internal.sse.RealEventSource.processResponse(RealEventSource.kt:75)
    at okhttp3.internal.sse.RealEventSource.onResponse(RealEventSource.kt:46)
    at okhttp3.internal.connection.RealCall$AsyncCall.run(RealCall.kt:519)
    at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
    at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
    at java.base/java.lang.Thread.run(Thread.java:840)

  • 0
    Certified Associate Developer
    in reply to Kaviarasu Mohan

    Hi  ,

    Server-Sent Events (SSE) require a long-lived, persistent HTTP connection to stream the LLM's response back to the user. If your downstream tool takes 30 to 60 seconds to execute, the AI pauses streaming.
    I would suggest check the idle timeout and read timeout settings of your downstream service.

    Moreover, the Appian chat component is waiting for the AI, and the AI is waiting for your tool to finish its work. If the tool hangs or takes too long, the underlying TCP socket simply gives up and drops.

    Can you try increasing these timeouts to accommodate the maximum duration your longest tool takes to run, plus the standard LLM processing time.

  • 0
    Certified Senior Developer
    in reply to kapilsharma

    Hi  ,

    Thank you for your reply.

    I am new to Appian and Chat Agents. Could you please help me understand where I can check and find the idle timeout and read timeout settings for the downstream service?

    Thank you for your assistance.