Repository navigation
⏱️ feat: Configurable Timeouts for the Web-Search Reranker and Image Generation - #16849
Open
kevinpark1217 wants to merge 1 commit into
Open
kevinpark1217 wants to merge 1 commit into
kevinpark1217 wants to merge 1 commit into
Conversation
kevinpark1217
force-pushed
the
feat/tool-timeouts
branch
from
October 7, 2026 02:22
8bba772 to
4de9efb
Compare
…Generation - Add `webSearch.rerankerTimeout` and pass it to `createSearchTool` - Add `IMAGE_GEN_OAI_TIMEOUT_MS` and `IMAGE_GEN_OAI_MAX_RETRIES` for the `image_gen_oai` client, applying the timeout to the undici dispatcher too
kevinpark1217
force-pushed
the
feat/tool-timeouts
branch
from
October 7, 2026 02:35
4de9efb to
aaf4d4b
Compare
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Two tool timeouts are fixed today, and slower self-hosted backends exceed them: the web-search rerank (10 s per page in
@librechat/agents) and theimage_gen_oaiOpenAI client. This PR makes both configurable:webSearch.rerankerTimeout(ms), passed tocreateSearchTool, which already accepts it.IMAGE_GEN_OAI_TIMEOUT_MSandIMAGE_GEN_OAI_MAX_RETRIES, passed to theimage_gen_oaiclient astimeoutandmaxRetries. These are env vars because the tool's other settings are too.The image timeout is also passed to the request's undici dispatcher as
headersTimeout/bodyTimeout, the same way the chat endpoints usetransportTimeouts. Without it, undici's 300 s defaults end the request first, and openai-node reports that asRequest timed out.When unset, behavior is unchanged.
Related to #16494
Related to LibreChat-AI/agents#290
Type of change
Testing
Added tests for schema validation, env parsing, dispatcher selection (direct and proxy), the
authResultpassthrough, and the options the OpenAI client receives. I also checked both settings against stub endpoints. WithrerankerTimeout: 500, a 1.5 s rerank is aborted at ~500 ms. WithIMAGE_GEN_OAI_TIMEOUT_MS=1800000, an image response held for 330 s succeeds; with only openai'stimeoutset, the same request fails at ~300 s.Screenshots / recordings
No user-facing change.
Checklist