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
Screenshot_2026-04-09_at_22.02.54 Screenshot_2026-04-09_at_22.40.19

How to set up and validate locally

  1. Put a sleep to project issues endpoint sleep(30)
  2. Go to a project page, open Duo Agentic chat
  3. Ask Duo to fetch project issues
  4. 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.

Edited by Halil Coban

Merge request reports

Loading