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