fix: exclude prompt_cache_key for Gemini API requests#790
Merged
alexhoshina merged 1 commit intosipeed:mainfrom Feb 26, 2026
Merged
fix: exclude prompt_cache_key for Gemini API requests#790alexhoshina merged 1 commit intosipeed:mainfrom
alexhoshina merged 1 commit intosipeed:mainfrom
Conversation
Gemini's OpenAI-compat endpoint rejects unknown fields. Only send prompt_cache_key to OpenAI-native endpoints.
2 tasks
Contributor
|
@rordd That Gemini compatibility fix is solid. The prompt_cache_key field silently breaking requests on generativelanguage.googleapis.com is the kind of edge case that's easy to overlook when adding OpenAI-specific features. Clean conditional approach. We have a PicoClaw Dev Group on Discord where contributors share ideas and collaborate. If you're interested, send an email to |
10 tasks
hyperwd
pushed a commit
to hyperwd/picoclaw
that referenced
this pull request
Mar 5, 2026
fix: exclude prompt_cache_key for Gemini API requests
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.
Problem
Gemini's OpenAI-compatible endpoint (
generativelanguage.googleapis.com) rejects unknown fields in the request body. Theprompt_cache_keyfield (added in #617) causes a 400 error:Solution
Only include
prompt_cache_keyin the request body for OpenAI-native endpoints. Skip it when the API base URL containsgenerativelanguage.googleapis.com.Testing
prompt_cache_keyas before