From a4a26d978ed6207e5b77a92f97789efbb880f6db Mon Sep 17 00:00:00 2001 From: Luis Pater Date: Wed, 26 Nov 2025 11:42:57 +0800 Subject: [PATCH] Fixed: #339 **feat(handlers, executor): add Gemini 3 Pro Preview support and refine Claude system instructions** - Added support for the new "Gemini 3 Pro Preview" action in Gemini handlers, including detailed metadata and configuration. - Removed redundant `cache_control` field from Claude system instructions for cleaner payload structure. --- internal/runtime/executor/claude_executor.go | 2 +- sdk/api/handlers/gemini/gemini_handlers.go | 21 ++++++++++++++++++++ 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/internal/runtime/executor/claude_executor.go b/internal/runtime/executor/claude_executor.go index 74988bc3..591b8f9e 100644 --- a/internal/runtime/executor/claude_executor.go +++ b/internal/runtime/executor/claude_executor.go @@ -679,7 +679,7 @@ func claudeCreds(a *cliproxyauth.Auth) (apiKey, baseURL string) { func checkSystemInstructions(payload []byte) []byte { system := gjson.GetBytes(payload, "system") - claudeCodeInstructions := `[{"type":"text","text":"You are Claude Code, Anthropic's official CLI for Claude.","cache_control":{"type":"ephemeral"}}]` + claudeCodeInstructions := `[{"type":"text","text":"You are Claude Code, Anthropic's official CLI for Claude."}]` if system.IsArray() { if gjson.GetBytes(payload, "system.0.text").String() != "You are Claude Code, Anthropic's official CLI for Claude." { system.ForEach(func(_, part gjson.Result) bool { diff --git a/sdk/api/handlers/gemini/gemini_handlers.go b/sdk/api/handlers/gemini/gemini_handlers.go index 8dcd9cb1..1f8828d5 100644 --- a/sdk/api/handlers/gemini/gemini_handlers.go +++ b/sdk/api/handlers/gemini/gemini_handlers.go @@ -69,6 +69,27 @@ func (h *GeminiAPIHandler) GeminiGetHandler(c *gin.Context) { return } switch request.Action { + case "gemini-3-pro-preview": + c.JSON(http.StatusOK, gin.H{ + "name": "gemini-3-pro-preview", + "version": "3", + "displayName": "Gemini 3 Pro Preview", + "description": "Gemini 3 Pro Preview", + "inputTokenLimit": 1048576, + "outputTokenLimit": 65536, + "supportedGenerationMethods": []string{ + "generateContent", + "countTokens", + "createCachedContent", + "batchGenerateContent", + }, + "temperature": 1, + "topP": 0.95, + "topK": 64, + "maxTemperature": 2, + "thinking": true, + }, + ) case "gemini-2.5-pro": c.JSON(http.StatusOK, gin.H{ "name": "models/gemini-2.5-pro",