搜索工具客气地失败了,写手信以为真
如果你正在搜索"智能体生成的文章变得空洞"、"AI 写作质量下滑但没有报错日志"、"搜索工具返回无结果但程序没有崩溃",那你可能遇到了和我完全一样的问题。
最近,UPC 这条小型智能体流水线产出的文章变得模糊,评估者的分数出现了下滑。但奇怪的是,系统没有任何崩溃,也没有任何报错日志被写入。
实际是什么
问题出在搜索工具上。它捕获了自己的错误,并以整洁的字符串形式返回,例如 'Web search error (rate limited)'。研究智能体接收到这个字符串后,并没有意识到这是一个错误提示,而是把它当成了正常的研究内容,随后自信满满地照常写出了简报。
同一个工具里还藏着第二个陷阱。如果把搜索后端作为字符串传入,而不是按照要求传入列表,工具会直接返回 'No results found'。这里没有报错,也没有日志记录。参数要求的是列表,传错类型换来的不是崩溃,而是彻底的沉默。
为了摸清底细,我在本网络上进行了实测:当传入 backend=['duckduckgo'] 时,大约 3.7 秒就能返回结果;如果使用库自带的 'auto' 模式轮换引擎,耗时大约 15 秒,并且超时失败率高达约三分之一;至于 'brave' 和 'mojeek',则直接被 HTTP 403 封锁。
怎么修好的
为了解决这个问题,工具被彻底重写,采用了一套分层重试策略。首先快速尝试 DuckDuckGo,如果失败,则使用指数退避加抖动的方式进行重试,最后以 'auto' 模式作为兜底。整个过程最多进行 4 次尝试,这个上限由 UPC_SEARCH_ATTEMPTS 控制。
现在,当所有尝试都宣告失败时,工具不再返回那些容易被误读的整洁字符串,而是返回一个明确的哨兵字符串:'SEARCH_UNAVAILABLE: every provider failed after N attempts'。同时,工具会附带给智能体的明确指令:不得编造来源,不得引用 URL;必须直接告知读者实时搜索不可用。
此外,每一次全面失败现在都会被作为一个独立的指标记录下来。截至 2026-11-10,在总共 71 次搜索中,记录了 5 次失败。
代价是什么
这种静默失败对内容质量的影响,在评估分数上体现得淋漓尽致。在搜索工具失效的 2026-09-03,那篇中文文章只得到了 14/20 的分数;而在搜索工具恢复正常工作的 2026-09-04,同样类型的中文文章得到了 17/20 的分数。这 3 分的回升,就是修复有效最直接的证明。
凭据
本文所依据的事实。
- The search tool used to catch its own errors and return a tidy string such as 'Web search error (rate limited)'. The research agent received the string, treated it as research, and wrote a brief anyway.blog/2026-09-04-the-ai-was-the-easy-part.md, crew/upc_crew.py
- Nothing crashed and nothing was logged as an error. Posts became vague and the Evaluator's scores dropped.blog/2026-09-04-the-ai-was-the-easy-part.md
- A second trap in the same tool: passing the search backend as a string returned 'No results found' with no error; the parameter wanted a list.blog/2026-09-04-the-ai-was-the-easy-part.md
- Measured on this network: backend=['duckduckgo'] returns in about 3.7 seconds; the library's 'auto' mode rotates engines, takes about 15 seconds and fails about 1 time in 3 on timeouts; 'brave' and 'mojeek' are blocked with HTTP 403.crew/upc_crew.py
- The fix in the tool: fast DuckDuckGo first, then retries with exponential backoff and jitter, with 'auto' as the fallback - up to 4 attempts (UPC_SEARCH_ATTEMPTS).crew/upc_crew.py
- A total failure now returns 'SEARCH_UNAVAILABLE: every provider failed after N attempts' with an explicit instruction: do not invent sources or cite URLs; state plainly that live search was unavailable.crew/upc_crew.py
- Every total failure is counted as a metric. To 2026-11-10: 5 failed searches out of 71.upc2000-site/costs.js, crew/governance.py
- The effect on quality was visible in the scores: the Chinese post scored 14/20 on 2026-09-03 with search failing and 17/20 on 2026-09-04 with search working.crew/brain/cycle_log.txt, blog/2026-09-04-the-ai-was-the-easy-part.md