From 955293754c12a10d13868312bf13d86670ed71b5 Mon Sep 17 00:00:00 2001 From: KGKallasmaa <29797627+KGKallasmaa@users.noreply.github.com> Date: Fri, 27 Nov 2026 11:00:17 +0100 Subject: [PATCH] feat(search): add Keenable as an optional keyed search provider Keenable joins Brave and Tavily as an optional provider in Settings > Web search. The keyless DuckDuckGo/Bing path stays the default; nothing changes unless the user picks Keenable and saves a key. Keyed only: there is no keyless Keenable path. - Provider enum, config schema and key storage follow the Brave/Tavily shape: the key is stored through SecretStore and never logged or sent to the renderer. - SearchService sends POST https://api.keenable.ai/v1/search with X-API-Key and X-Keenable-Title: Pi Bot, only on Keenable requests; the result text is read from snippet (description is always empty). - search-run maps 429, 401/403, 402 and other HTTP errors to a message that says what to do (switch provider or fix the key) instead of an empty result. SearchStatusError carries the status from searchJson; other providers' messages are unchanged. - UI text in packages/i18n (zh and en); the settings copy says Keenable logs requests under its default data policy and that a key does not turn logging off. - docs/privacy and docs/guide updated in both languages. - Offline tests cover the default staying keyless, the request shape, no header leakage to other providers, key removal and the error messages. Signed-off-by: KGKallasmaa <29797627+KGKallasmaa@users.noreply.github.com> --- .../features/settings/search-settings.tsx | 12 +- docs/guide/en/09-models-and-keys.md | 2 +- docs/guide/zh/09-models-and-keys.md | 2 +- docs/privacy/en/outbound-connections.md | 6 +- docs/privacy/zh/outbound-connections.md | 6 +- packages/brain/src/core/audit-fields.ts | 1 + .../brain/src/core/personas/capabilities.ts | 1 + .../src/integrations/search/search-run.ts | 27 +++- .../search/search-service.keenable.test.ts | 134 ++++++++++++++++++ .../src/integrations/search/search-service.ts | 25 +++- packages/client-core/src/audit/facts.ts | 1 + packages/execution/src/index.ts | 2 +- packages/execution/src/web/search-http.ts | 8 +- packages/i18n/src/sections/provider-auth.ts | 2 + packages/i18n/src/sections/settings-pages.ts | 6 + packages/protocol-base/src/app/search.ts | 4 +- packages/protocol-base/src/providers/auth.ts | 5 + 17 files changed, 225 insertions(+), 19 deletions(-) create mode 100644 packages/brain/src/integrations/search/search-service.keenable.test.ts diff --git a/apps/desktop/src/renderer/features/settings/search-settings.tsx b/apps/desktop/src/renderer/features/settings/search-settings.tsx index 992fe776..021bb964 100644 --- a/apps/desktop/src/renderer/features/settings/search-settings.tsx +++ b/apps/desktop/src/renderer/features/settings/search-settings.tsx @@ -15,7 +15,15 @@ import { requirePeer, writeCredential } from "./operations.ts"; import css from "./search-settings.module.css"; type SearchProvider = SearchConfig["provider"]; -const PROVIDERS = ["keyless", "duckduckgo", "bing", "brave", "tavily", "searxng"] as const; +const PROVIDERS = [ + "keyless", + "duckduckgo", + "bing", + "brave", + "tavily", + "keenable", + "searxng", +] as const; const keyFree = (provider: SearchProvider): provider is "keyless" | "duckduckgo" | "bing" => provider === "keyless" || provider === "duckduckgo" || provider === "bing"; @@ -152,7 +160,7 @@ export function SearchSettings() { ))} - {(provider === "brave" || provider === "tavily") && ( + {(provider === "brave" || provider === "tavily" || provider === "keenable") && (