← Back to Pull requests

Make the OpenAI-compatible LLM request timeout configurable #732

Closed
unknown closed this pull request without merging on Oct 29, 2026 10:52 UTC
View on GitHub
unknown unknown commented on Oct 17, 2026 22:21 UTC
Author

What

Adds --responses_api_request_timeout_s (default 20.0, unchanged) to the OpenAI-compatible LLM backends (chat-completions and responses-api). The field lives on ResponsesApiLanguageModelHandlerArguments (inherited by ChatCompletionsLanguageModelHandlerArguments), so normalize_dataclass_config strips the prefix and it plumbs straight into the existing BaseOpenAICompatibleHandler.request_timeout_s — no handler changes needed.

Why

The read timeout bounds the wait for the upstream model to start answering. With agent-style backends — an OpenAI-compatible endpoint that runs a full tool-using agent turn before replying (self-hosted assistant servers, MCP orchestrators, etc.) — replies routinely take 20-60s. Today the request dies at the hardcoded 20s, the pipeline speaks PROVIDER_FAILURE_FALLBACK ("I'm having trouble responding right now. Please try again." — the fallback added in #471), and long agent turns become unusable over voice.

Real-world reproduction: pointing chat-completions at a self-hosted agent server where every turn takes 15-40s, every longer reply triggered the fallback; at 90s the same turns complete. The connect timeout remains capped at 10s (min(10.0, request_timeout_s)) exactly as before, and the default is unchanged so existing deployments see no behavior difference.

Tests

  • default value assertion (20.0)

  • flag → normalized config mapping for both backends (chat-completions, responses-api)

  • full tests/test_cli_defaults.py: 106 passed
  • Usage: speech-to-speech serve --llm_backend chat-completions --responses_api_base_url https://my-agent.example/v1 --responses_api_api_key ... --responses_api_request_timeout_s 90

    Diff: 214 lines (+160 / -54) across 2 files Reviewer: jackboyla Review duration: 16591m
    All Vouch review confidence checks passed
    Residual risk 0.27 = Change Risk (0.65) × (1 − Review Confidence (0.58)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.65 · 214 lines diff across 2 files
    0.65
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.17 · 1 substantive comment(s)
    0.17
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    57%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Diff Size diff_size
    0.321
    Shallow Review Depth shallow_review_depth
    0.289
    Sensitive Paths sensitive_paths
    0.065
    Ai Authored ai_authored
    0.050
    Real PR Conversation Timeline
    1 comments
    "Review active on #732"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 58.0% reviewed sensitive_module
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 64.8% (MEDIUM) · Higher = larger blast radius
    64.8%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 58.0% · Lower = rushed or shallow review
    58.0%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 27.2% · Safe to merge
    27.2%