Add a timeout to dap http requests behind feature flag
What does this MR do and why?
This MR adds a timeout to http requests for DAP in workhorse.
Why
Scenario 1. When a flow is stopped (eg chat flow browser close) workhorse sends a stop request to duo workflow service, then waits for 10 seconds for it to be closed. In the meanwhile processes ongoing requests. However, some requests takes longer than 10 seconds which results in force disconnects (Cancelled GRPC status code). Eg
Scenario 2. When a request times out from rack, DWS is receiving it as 500 making it unclear for the LLM.
This MR adds a timeout behind a feature flag. Also, sends the correct error back to DWS.
References
Closes #596002
Screenshots or screen recordings
| Before | After |
|---|---|
![]() |
![]() |
How to set up and validate locally
- Put a sleep to project issues endpoint
sleep(30) - Go to a project page, open Duo Agentic chat
- Ask Duo to fetch project issues
- After 5 seconds you should see that request timed out
MR acceptance checklist
Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

