/vault-agents:search-fallbackfrom vault-agents
Fallback web search when the host search tool is unavailable, quota-exhausted (QUOTA_EXHAUSTED) or timing out. Order: switch the host plugin's provider first, then DuckDuckGo Lite -> Baidu (via browser, with dates) -> Bing RSS (last resort, often polluted). Use when an agent must search from a shell, needs dated Chinese news, or must cross-check a claim across engines. Not for logged-in pages, JS-heavy sites, or paywalled content.
Ships in vault-agents. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them; scripts run unread.
Host search failed (quota / timeout / not installed) → first try to repair the host path by switching its provider, then walk the ladder below. Stop at the first engine whose top results actually match the query.
QUOTA_EXHAUSTED 先换源,别直接降级 → 见「先换源,再降级」。https://lite.duckduckgo.com/lite/?q=...
10 clean results, real URLs, no JS. Best for English / technical queries.
HTTP 202 + page contains anomaly = rate-limited. In CN networks it may stay
blocked for the whole session (observed: still 202 after 35s) → switch to Baidu.tn=news is the only ordering that
keeps dates.
curl gets 百度安全验证 → must use cindy_browser.https://www.baidu.com/s?word=<urlencoded>&tn=news&rtt=1&bsst=1&cl=2
(word=, not wd=; keep it identical to the payload below).scripts/baidu_extract.json,不要手抄选择器;它用一个 .c-color-text 兜底。from 只接受一个字符串:多个选择器用逗号连成一个,不能传数组。
afterSnapshot 不接受 compact(unrecognized_keys)。baijiahao redirects → fine for reading, weak for citation....&format=rss — last resort only.
RSS items do carry pubDate; the script just doesn't parse it.
宿主搜索插件 cindy-web-search 自带 BYO 渠道。QUOTA_EXHAUSTED 是托管源没钱了,不是查询写错;
先换源,不要直接掉到 2–5 步。
三种换法,按代价从小到大:
| 做法 | 改动范围 | 什么时候用 |
|---|---|---|
单次传 args.provider | 只影响这一次调用 | 临时查一下;最安全、可逆 |
| 改 kv 默认源 | 之后所有轮次 | 长期不想用托管源 |
| 绕开插件直搜 | 不碰插件 | 插件不可用,或一个 key 都没有 |
单次指定:search_web 接受 provider(cindy / brave / tavily / deepseek),
参数优先于 kv,传了就按它走。
改默认源:偏好文件 <APPDATA>/Cindy/owners/<owner>/ghost-kv/cindy-web-search.json,
写成 {"cindyAiEnabled":false,"byoDefaultProvider":"deepseek"}。只写 byoDefaultProvider
不生效 —— cindyAiEnabled 仍为 true 时,没传 provider 的调用继续走托管源。
改完下一次调用即生效,不用重启(2026-11-14 实测:改前同一条查询 QUOTA_EXHAUSTED,
改后返回 provider:"deepseek" 并给出结果)。
先确认 key 到底有的哪几个(目录不在 owners/<owner>/ 下):
ls "$APPDATA/Cindy/safe-storage" | grep ghost_secret_cindy-web-search
# owner_<id>_ghost_secret_cindy-web-search_deepseek_api_key.enc
代价:BYO 按成功请求计费;DeepSeek 查询上限 128 个 Unicode 字符,长问题先压成关键词。
fetch_page 走 Tavily,与这个开关无关。一个可用 key 都没有时,才继续 2–5 步。
owner=$(ls -d "$APPDATA/Cindy/owners"/* | head -1)
cat "$owner/ghost-kv/cindy-web-search.json"
# 真正生效的判据是工具返回的 provider 字段,不是文件内容:
# ghost_call {ghost_id: "cindy-web-search", tool: "search_web",
# args: {query: "<≤128 字符>", limit: 2}}
# → {"ok":true,"result":{"provider":"deepseek","results":[...]}}
返回里还是 provider:"cindy" 时,按概率查三处:① 这次调用或上层封装显式传了
provider:"cindy"(参数优先于 kv);② kv 被别的会话改回 cindyAiEnabled:true;
③ 目标 provider 的 .enc 不存在。不要把「文件写对了」当成「已经换源」。
export PYTHONIOENCODING=utf-8 # Windows console is GBK
python scripts/search.py "claude agent skills 2026" -n 8
python scripts/search.py "北京 AI 教育 指南" -n 8 --engine ddg # 中文仍建议走百度浏览器
Output: {query, engine, count, results:[{title,url,snippet}]}.
Exit code 2 = nothing parsed (engine blocked or query too ambiguous).
脚本只实现阶梯第 2 与第 4 步,没有百度;auto 在 DDG 空结果后直接落到 Bing。
中文或需要日期的查询,显式走第 3 步的浏览器路径,不要用 auto。
UnicodeEncodeError: 'gbk' codec → PYTHONIOENCODING=utf-8./tmp ≠ Windows Python /tmp (that resolves to C:\tmp).
Use workspace-relative paths; never hand /tmp/x from bash to python.3天前); only tn=news preserves ordering.search.py 用 curl 抓页并丢掉状态码,脚本自己的判据只有正文里的 anomaly;
想确认是否被限流,得看浏览器或原始响应。QUOTA_EXHAUSTED —— 先读返回的 provider,不要重复同一个引擎。snapshot, not this.fetch_page 比爬 HTML 稳,但它会把完整 URL 发给 Tavily,
必须先拿到用户对「公开页面 + 允许外发」的明确同意,再传 confirm_public_url=true。What SKILL.md sets; muted values are Claude Code's defaults
5 skills in this plugin
Other plugins' skills for the same job
/colleague-ue-tech-planner把 UE 项目目标转成有明确取舍、依赖、验收物与缓冲的执行计划。npx claudepluginhub yhyu13/agentskillsvault --plugin vault-agents