Commit Graph

14 Commits

Author SHA1 Message Date
Mauro 99291182e7 Merge pull request #3141 from jincheng-xydt/fix/3125-brave-search-logging
fix(web_search): add diagnostic logging for Brave empty results
2026-06-18 08:16:14 +02:00
肆月 7b5fe01187 fix(web): update sogou search regex to match new HTML structure (#3139)
- reSogouTitle: make class attribute quotes optional (class="?resultLink"?)
- reSogouSnippet: allow additional CSS classes after clamp (clamp\d*[^"]*)

Sogou WAP search page changed its HTML format:
- class=resultLink -> class="resultLink" (added quotes)
- class="clamp3" -> class="clamp2 fz-mid click-sugg-content" (extra classes)

Fixes web_search tool failing to parse sogou search results.
2026-06-17 17:02:54 +08:00
lc6464 1420875921 fix(onebot): tighten inbound media download handling 2026-06-17 17:00:24 +08:00
lc6464 234bd03018 fix(onebot): block private inbound media fetches 2026-06-17 17:00:24 +08:00
徐金城0668000897 b2fbe83565 fix(web_search): add diagnostic logging for Brave empty results
When the Brave Search API returns HTTP 200 with zero results, log a
warning with the response body preview to help diagnose silent failures.
This addresses cases where the API response format has changed or a
non-standard error response is misinterpreted as a successful empty
result, leaving the LLM with a misleading "No results" message.

Previously, empty results were silently returned to the LLM as "No
results for: <query>", making it impossible to distinguish between
genuinely empty results and API format mismatches or silent errors.

Closes #3125
2026-06-17 16:23:25 +08:00
Mauro fa6ed714c4 Merge pull request #3060 from chengzhichao-xydt/codex/error-wrap-and-marshal
fix: use %w for error wrapping and handle json.MarshalIndent error
2026-06-11 18:36:55 +02:00
Yue_chen 2ecdb893d5 fix(tools): block 198.18.0.0/15 in SSRF guard
RFC 2544 benchmark addresses (198.18.0.0/15) are not globally routable
but were missing from the isPrivateOrRestrictedIP blocklist, allowing
SSRF bypasses via literal IPv4.

Fixes #3077
2026-06-09 19:01:42 +08:00
程智超0668000959 e2112e627c fix: use %w for error wrapping and handle json.MarshalIndent error 2026-06-09 09:04:56 +08:00
程智超0668000959 a4e8fe953e fix(webfetch): add ok check for type assertion in isAllowedFirstHopHost 2026-06-08 17:25:44 +08:00
jp39 0a3a7881c6 Add native Kagi web search provider 2026-06-07 16:27:50 +02:00
Anton Bogdanovich 794eb04f32 feat(providers): add gemini web search provider (#2763)
* add gemini web search provider

* fix(web): prefer free providers before Gemini in auto mode

* fix(web): expose gemini api key and model settings

* fix(web): prefer configured providers before Gemini in auto mode

* fix(web): satisfy gemini lint checks

* fix(web): address gemini provider review feedback

* test(web): align auto-provider expectations

* fix(web): let gemini ignore search range
2026-05-14 09:50:47 +08:00
Junghwan 293477b02a Keep launcher locale changes from mutating shared web-search routing (#2573)
The launcher wired UI language changes into a process-global backend
switch that changed auto web-search provider selection and the
reported current service for every handler in the same process.

This narrows the fix to the validated leak: remove backend sync from
frontend locale changes, drop the now-unused UI endpoint, and make
auto selection fall back to a stable default when the query itself
does not contain a script hint.

Constraint: Keep the patch small and mergeable without redesigning per-user preference storage
Rejected: Add per-user backend language state | larger scope than the validated bug and unclear maintainer preference
Rejected: Persist preferred language in config | still shares mutable state across clients of the same instance
Confidence: high
Scope-risk: narrow
Reversibility: clean
Directive: If locale-aware provider routing is reintroduced later, scope it to explicit config or request context instead of package-global state
Tested: go test ./web/backend/api ./pkg/tools -count=1; pnpm lint; pnpm build
Not-tested: Full make check; live multi-browser manual launcher run after the backend endpoint removal
2026-04-24 13:45:25 +08:00
wenjie cac4f21746 fix(tools): improve web search provider fallback (#2629)
- centralize web search provider readiness and resolution logic
- fall back when the configured provider is unavailable or invalid
- allow native-search-capable models to use built-in search without the client tool
- simplify the tools page and add direct access to web search settings
- add backend, agent, and integration tests for the new selection behavior
2026-04-23 15:39:16 +08:00
lc6464 4c133dc2d9 refactor(tools): reorganize tool packages and facades 2026-04-17 13:44:31 +08:00