Repository navigation
feat(cindy-web-search): add AnySearch search provider - #197
HpIahtcthocw wants to merge 4 commits into
Conversation
Signed-off-by: HpIahtcthocw <3154200873@qq.com>
🤖 Contributor checklist / 贡献检查清单Hi @HpIahtcthocw, the following items are still open / 以下事项尚待处理:
Version bump ( Updated automatically for 6bad15d (author association: NONE). See CONTRIBUTING.md / CONTRIBUTING.zh-CN.md. 本评论自动更新。 |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Thanks for the thorough PR — the code itself is clean. Since this adds a new third-party network host to a built-in plugin, a maintainer will decide whether to accept AnySearch as a provider. One concrete safety question in the meantime: Unlike Brave / Tavily / DeepSeek, AnySearch works with no key, so the model can pass |
[Medium impact] No code findings remain, but maintainer review and the acknowledged device check are still required before release.
|
Signed-off-by: HpIahtcthocw <3154200873@qq.com>
|
@zqchris thanks for the review — both points are valid. I've pushed a fix. 1. Anonymous calls now fail closed unless the user explicitly opted in
This applies to both the default route and an explicit 2. AnySearch privacy / data-retention policy (anonymous queries) From AnySearch's official FAQ (https://anysearch.com/faq):
This is corroborated by third-party reporting on the service (MIT Technology Review China, ITHome): zero-retention execution — query data is discarded immediately after processing, no tracking, no telemetry, no logging. Queries sent anonymously are subject to the daily free quota and IP rate limits described in the API docs (a 402 carries auto-generated credentials, which this plugin never relays). Note the practical posture stays conservative regardless: anonymous usage is now opt-in only, and users can always configure their own key or stick to Cindy AI. |
…tions and settings Signed-off-by: HpIahtcthocw <3154200873@qq.com>
…illing note Signed-off-by: HpIahtcthocw <3154200873@qq.com>
|
Thanks for the contribution. We're not going to add AnySearch to the official built-in search plugin: it would let the model route user queries anonymously to a third-party service the user never chose, and we'd rather keep the built-in provider list small. Closing for now. |
What changed
Add AnySearch as a new search provider for the
cindy-web-searchplugin:ghost.json: version 1.4.0 → 1.5.0; declareapi.anysearch.comhost and an optionalanysearch_api_keysecret (Bearer injection, host-scoped); extend thesearch_webprovider enum withanysearch; update the tool description.main.js: newsearchAnySearch()— POST https://api.anysearch.com/v1/search with{ query, max_results }; mapsdata.results(snippet falls back tocontent); classifies HTTP errors (400/401/402/403/415/429/5xx) into actionable messages; never relays upstream bodies (a 402 body may contain auto-generated credentials); no retry or provider fallback, consistent with the other providers.settings.html/settings.js: AnySearch option in the BYO provider dropdown plus an optional key row. Keyless (anonymous) usage is supported and called out in the UI.locales/*: zh-CN / en / ja / ko updated for AnySearch..tests/cindy-web-search.test.mjs: updated manifest assertions plus 28 new tests (request shape, BYO default, shared 1–10 limit contract, HTTP error mapping including 402 credential non-leakage, structured host error codes, malformed/truncated/non-zero-code responses, settings persistence).Why
Closes #2401 (Web Search 插件支持自定义/更多搜索 provider). AnySearch provides a free search source that works anonymously without an API key and is accessible from mainland China — exactly the "免费源" requested in the issue. The AnySearch open-source bounty programme confirmed that plugin-form integration into the official plugin repo is an acceptable integration.
Checklist
node_modules.ghost.jsondeclares only capabilities actually used: one new network host (api.anysearch.com) and one optional secret (Bearer, host-scoped); justified in this description.descriptionmatches actual behavior; settings copy stays consistent with it.ghost.jsonversionto 1.5.0 (greater than main's 1.4.0)..cindyon a real device running a stable production or Beta Cindy build (dev/local builds do not qualify). Will verify once the PR test package is available and record the verified version/channel here.minCindyVersionchange.node --test .tests/localization.test.mjs— 2 of 3 pass; the failing test (plugins never infer language from the browser or operating system) fails onmy-browser/extension/vendor/tesseract/*.wasm.jsand is pre-existing onmain, unrelated to this PR.src/change (nonode/worker.cjsrebuild needed).git commit -s).Verification
node scripts/validate-plugin-manifest.mjs ./cindy-web-search→cindy-web-search\ghost.json: valid Cindy plugin manifest.node --test .tests/cindy-web-search.test.mjs→ 68/68 pass (40 existing + 28 new).node --test .tests/localization.test.mjs→ 2/3 pass; the 1 failure is pre-existing onmain(my-browser tesseract vendor binary), unrelated to this PR.Sensitive changes
ghost.json(documented above). No OAuth/API scope change, no dependency/vendor/binary resources, no provisioning audience change, nominCindyVersionreduction. Diff scanned for credentials/tokens — none found (the onlypassword/api_keystrings are test fixtures asserting 402 credential non-leakage and a standard password input element).