- Merge request !914[#3547635] feat: Add configurable HTTP request timeout for AI providers → (Open) created by doxigo
Translating large TMGMT
jobs or even ai_translate
via the ai provider often fails with
cURL error 28: Operation timed out after 60003 milliseconds
because the base HTTP client in AiProviderClientBase
hardcodes a 60s
timeout.
ResponseText: The website encountered an unexpected error. Try again later.Drupal\ai\Exception\AiRequestErrorException: Error invoking model response: cURL error 28: Operation timed out after 6000 milliseconds with 0 bytes received (see https://curl.haxx.se/libcurl/c/libcurl-errors.html) for https://api.openai.com/v1/chat/completions in Drupal\ai\Plugin\ProviderProxy->wrapperCall() (line 309 of modules/contrib/ai/src/Plugin/ProviderProxy.php). Drupal\ai\Plugin\ProviderProxy->__call() (Line: 279)
This aborts AJAX batch calls and interrupts translations that legitimately need more time (e.g., multi-field jobs, slow upstream responses).
Configure an AI provider (e.g., OpenAI) and set up an ai_tmgmt
translator or any other translation provider for that matter.
Create a translation job with several long HTML fields, the more complex markup the better for testing.
Run the job via the UI, allowing the batch process to operate for more than 60s.
Observe that the batch request fails with HTTP 500 / AiRequestErrorException
referencing cURL error 28.
Introduce a configurable timeout so site owners can raise the limit (or disable it) without patching core code or overriding it in the settings.php
would be nice. Considering this type of work really depends on the model as well (meaning some models might take a long time to respond, eg, thinking models)
Active
1.2
...to be triaged
Not all content is available!
It's likely this issue predates Contrib.social: some issue and comment data are missing.