Skip to content

search: make the search deadlines configurable - #15495

Merged
diegosouzapw merged 1 commit into
diegosouzapw:release/v3.8.52from
HouMinXi:feat/search-timeout-setting
Oct 6, 2026
Merged

diegosouzapw merged 1 commit into
diegosouzapw:release/v3.8.52from
HouMinXi:feat/search-timeout-setting

Conversation

@HouMinXi

@HouMinXi HouMinXi commented Oct 4, 2026

Copy link
Copy Markdown
Contributor

What

/v1/search cuts a request off at a fixed 15 seconds, and each provider has its own fixed timeout on top of that (10 seconds for exa, tavily and context7). A slow upstream comes back as This operation was aborted, and there is no setting to raise either number.

This adds two settings:

  • searchTimeoutMs sets the whole-request budget. It drives the three provider execution paths and the failover window together, so raising it cannot leave one path on the old constant.
  • searchProviderTimeoutsMs overrides a single provider's own timeout, keyed by provider id.

Both are unset by default, and unset means the old values. The settings page gets a "Search timeouts" card under Routing. The number fields save when they lose focus, so a half-typed value is never stored, and a non-numeric entry is ignored.

Tests

tests/unit/search-timeout-budget.test.ts hangs the upstream fetch and checks three things: a 50ms budget cuts the request off, no budget still cuts it off at the default, and a per-provider override beats that provider's own 10 second timeout. Removing either wiring makes the matching test wait the full 10 seconds and fail.

Scope

No change to the default behaviour. Existing search tests pass unchanged.

Both deadlines were constants, so a slow search provider was cut off at
10-15 seconds with no way to raise it. searchTimeoutMs sets the whole
request budget and searchProviderTimeoutsMs overrides one provider.
Unset, both keep their old values. The settings page gets a card for
them, and the inputs save on blur so a half-typed number is not stored.

Signed-off-by: Minxi Hou <houminxi@gmail.com>
@HouMinXi
HouMinXi requested a review from diegosouzapw as a code owner October 4, 2026 03:48
@diegosouzapw
diegosouzapw merged commit 15c9588 into diegosouzapw:release/v3.8.52 Oct 6, 2026
41 of 51 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants