fix(web-search): polish Keenable provider integration after #1946

Expose optional API key in settings UI, map longer API snippets into Content
for RAG, align maxResults fallback with other providers, sync Swagger enum,
and add follow-up unit tests.
This commit is contained in:
wizardchen
2026-07-07 17:06:56 +08:00
committed by lyingbug
parent 8cf9f1c882
commit 77cf6a5789
13 changed files with 104 additions and 14 deletions
@@ -52,6 +52,20 @@ func TestEmptyTestResultsError_DuckDuckGo(t *testing.T) {
}
}
func TestEmptyTestResultsError_Keenable(t *testing.T) {
err := EmptyTestResultsError(string(types.WebSearchProviderTypeKeenable), nil)
if err == nil {
t.Fatal("expected error")
}
msg := err.Error()
if !strings.Contains(msg, "keenable returned 0 results") {
t.Fatalf("unexpected message: %q", msg)
}
if !strings.Contains(msg, "rate-limited") {
t.Fatalf("keenable message should hint at the keyless rate limit: %q", msg)
}
}
func TestEmptyTestResultsError_APIKeyProviders(t *testing.T) {
err := EmptyTestResultsError(string(types.WebSearchProviderTypeBing), nil)
if err == nil {