Skip to content

fix: add request timeout and malformed-envelope guard to AnySearch search - #6664

Closed
tbontb-iaq wants to merge 1 commit into
Mintplex-Labs:masterfrom
tbontb-iaq:fix/anysearch-robustness
Closed

tbontb-iaq wants to merge 1 commit into
Mintplex-Labs:masterfrom
tbontb-iaq:fix/anysearch-robustness

Conversation

@tbontb-iaq

Copy link
Copy Markdown
Contributor

What

Small robustness fixes for the AnySearch agent web-search provider added in #6439:

  • Adds a 20s request timeout (AbortSignal.timeout) so a hanging API call can't stall the agent invocation indefinitely.
  • Treats a code: 0 envelope missing data.results as an explicit error instead of silently reporting "no results found", which made malformed responses indistinguishable from genuine empty results.

Single file, no behavior change on the happy path.

Context

My earlier follow-up #6466 was closed without feedback, and a comment asking which parts might be acceptable went unanswered — so rather than guess, I've reduced this to the smallest, most isolated piece from it: 5 lines, no schema changes, no tests, no changes to existing behavior beyond the two failure modes above. Apologies if this is unwanted noise; a plain close with no hard feelings is a fine answer.

@timothycarambat

Copy link
Copy Markdown
Member

Thanks for trimming this down, and sorry #6466 got closed without an explanation.

We're going to pass on this one. Neither change fixes a failure anyone has run into. Node's fetch already gives up after about 5 minutes, and we haven't seen AnySearch return code: 0 without results. If we add request timeouts, we'd want them on every search provider in web-browsing.js at once rather than on one. If AnySearch starts behaving badly for real users, please open an issue with the response you got and we'll look at it.

@tbontb-iaq

Copy link
Copy Markdown
Contributor Author

Understood, thanks for taking the time to explain — appreciated.

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