fix: make upstream timeout configurable and increase default to 300s (#787)

Hardcoded 30s timeouts in envoy config caused premature termination of
long-running LLM requests (tool-use, agentic workflows). Make timeouts
configurable via upstream_timeout_ms override and default to 300s.
This commit is contained in:
Syed Hashmi 2026-03-04 18:53:32 -06:00
parent 0c7b999770
commit 00bd11061e
2 changed files with 12 additions and 3 deletions

View file

@ -466,6 +466,15 @@ def validate_and_render_schema():
"upstream_tls_ca_path", "/etc/ssl/certs/ca-certificates.crt"
)
upstream_timeout_ms = overrides.get("upstream_timeout_ms")
if upstream_timeout_ms is not None:
timeout_s = f"{int(upstream_timeout_ms) // 1000}s"
llm_gateway["timeout"] = timeout_s
prompt_gateway["timeout"] = timeout_s
for listener in listeners:
if listener.get("type") == "agent" and "timeout" not in listener:
listener["timeout"] = timeout_s
data = {
"prompt_gateway_listener": prompt_gateway,
"llm_gateway_listener": llm_gateway,