Repository navigation
fix(search): reuse Gemini and Kimi caches for equivalent queries - #126798
Merged
Merged
Conversation
Contributor
|
🦞👀 Pull request received. I will update this pull request when review starts. |
steipete
marked this pull request as ready for review
August 20, 2026 18:51
Contributor
Author
|
Merged via squash.
|
github-actions Bot
pushed a commit
to Desicool/openclaw
that referenced
this pull request
Aug 21, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What Problem This Solves
Fixes an issue where Gemini and Kimi web searches repeated billable provider requests for the same query when callers supplied different result counts, even though both providers ignore that parameter. Gemini searches using relative freshness or open-ended dates also missed their documented cache whenever the clock advanced.
Why This Change Was Made
Keep count validation but remove ignored count settings from each provider-owned cache identity, matching the existing Grok provider. Carry Gemini's normalized freshness and explicit date bounds into the cache key while preserving the real, current timestamps sent to Google Search grounding. Model, endpoint, operator-header partitioning, cache TTL, and public plugin SDK contracts stay unchanged.
User Impact
Equivalent Gemini and Kimi searches now reuse the configured search cache, reducing duplicate paid requests and latency. Distinct Gemini freshness windows, date ranges, models, endpoints, and operator headers remain isolated, and invalid result counts continue to fail visibly.
Evidence
4e8a75ea3988a7fc2175ba113d171bb3f6964ed1.PNPM_CONFIG_MODULES_DIR=/Users/steipete/Projects/openclaw/node_modules OPENCLAW_VITEST_MAX_WORKERS=1 OPENCLAW_VITEST_FS_MODULE_CACHE=0 NODE_DISABLE_COMPILE_CACHE=1 node scripts/run-vitest.mjs run --config test/vitest/vitest.extension-providers.config.ts --configLoader runner extensions/google/web-search-provider.test.ts extensions/moonshot/src/kimi-web-search-provider.test.ts extensions/moonshot/index.test.ts— 3 files, 81 tests passed, including the already-landed Kimi unfinished-answer/retry regression.node --import tsx scripts/check-assertion-safety-ratchet.mts— passed.node --import tsx scripts/check-max-lines-ratchet.mts— passed.node_modules/.bin/oxfmt --check extensions/google/src/gemini-web-search-provider.runtime.ts extensions/google/web-search-provider.test.ts extensions/moonshot/src/kimi-web-search-provider.runtime.ts extensions/moonshot/src/kimi-web-search-provider.test.ts— passed.