Skip to content

fix(web): apply 15s timeout to all search engines (#2252 follow-up)#2259

Merged
esengine merged 1 commit into
esengine:mainfrom
nianyi778:fix/search-engine-timeouts
May 29, 2026
Merged

fix(web): apply 15s timeout to all search engines (#2252 follow-up)#2259
esengine merged 1 commit into
esengine:mainfrom
nianyi778:fix/search-engine-timeouts

Conversation

@nianyi778

Copy link
Copy Markdown

问题

#2252searchBing 加了 15s 超时防止无限挂起,但其他搜索引擎(Searxng、Metaso、Baidu、Tavily、Perplexity、Exa、Ollama、Brave)仍然只依赖 opts.signal,可能无限挂起。

修复

提取 searchSignal() 辅助函数,将 caller 的 abort 信号与 SEARCH_TIMEOUT_MS(15s)合并,统一应用到所有搜索引擎。

…ow-up)

esengine#2252 added a 15s AbortSignal.timeout to searchBing; the other engines
(Searxng, Metaso, Baidu, Tavily, Perplexity, Exa, Ollama, Brave) still
relied on opts.signal only and could hang indefinitely.

Extract searchSignal() helper that combines the caller's abort signal with
a per-request SEARCH_TIMEOUT_MS cap, and apply it uniformly.
@nianyi778

Copy link
Copy Markdown
Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Bravo.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@esengine esengine left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Clean, correct follow-up to #2252. Extracting searchSignal(callerSignal) — which merges the caller's abort signal with AbortSignal.timeout(SEARCH_TIMEOUT_MS) via AbortSignal.any — and applying it to every engine (Searxng, Metaso, Baidu, Tavily, Perplexity, Exa, Ollama, Brave) closes the same indefinite-hang gap I just merged for Bing, and it folds the inline Bing timeout from #2252 into the shared helper so there's no duplication. The caller's cancellation is preserved in all paths. Single-file, CI green (build ubuntu+windows + CodeQL). LGTM.

@esengine esengine merged commit d83a0bd into esengine:main May 29, 2026
4 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