From 4a85b6b97e19de77b0ffd57baa6af8dc8d20304d Mon Sep 17 00:00:00 2001 From: sususu98 Date: Tue, 26 May 2026 10:52:53 +0800 Subject: [PATCH] fix: log gemini cli schema cleanup errors --- internal/runtime/executor/gemini_cli_executor.go | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/internal/runtime/executor/gemini_cli_executor.go b/internal/runtime/executor/gemini_cli_executor.go index af93a3f34..95fcd9e0c 100644 --- a/internal/runtime/executor/gemini_cli_executor.go +++ b/internal/runtime/executor/gemini_cli_executor.go @@ -889,7 +889,12 @@ func cleanGeminiCLIRequestSchemas(body []byte) []byte { } cleaned := util.CleanJSONSchemaForGemini(params.Raw) path := fmt.Sprintf("request.tools.%d.%s.%d.%s", i, declarationsKey, j, schemaKey) - body, _ = sjson.SetRawBytes(body, path, []byte(cleaned)) + updated, errSet := sjson.SetRawBytes(body, path, []byte(cleaned)) + if errSet != nil { + log.Errorf("gemini cli executor: failed to set cleaned schema at %s: %v", path, errSet) + continue + } + body = updated } } } @@ -905,7 +910,12 @@ func cleanGeminiCLIRequestSchemas(body []byte) []byte { continue } cleaned := util.CleanJSONSchemaForGemini(responseSchema.Raw) - body, _ = sjson.SetRawBytes(body, schemaPath, []byte(cleaned)) + updated, errSet := sjson.SetRawBytes(body, schemaPath, []byte(cleaned)) + if errSet != nil { + log.Errorf("gemini cli executor: failed to set cleaned response schema at %s: %v", schemaPath, errSet) + continue + } + body = updated } return body