From 8c4a43cf726e9f498bbf824fcb1a82f911efa933 Mon Sep 17 00:00:00 2001 From: a0yark <565766533@qq.com> Date: Tue, 16 Jun 2026 23:19:45 +0800 Subject: [PATCH] fix(gemini): satisfy schema cleanup test lint Co-authored-by: Cursor --- .../gemini_messages_compat_service_test.go | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/backend/internal/service/gemini_messages_compat_service_test.go b/backend/internal/service/gemini_messages_compat_service_test.go index c4bbd8957d..b2fc1c110b 100644 --- a/backend/internal/service/gemini_messages_compat_service_test.go +++ b/backend/internal/service/gemini_messages_compat_service_test.go @@ -323,9 +323,18 @@ func TestCleanToolSchema_NormalizesGeminiUnsupportedSchemaFields(t *testing.T) { properties, ok := cleaned["properties"].(map[string]any) require.True(t, ok) - require.Equal(t, "STRING", properties["path"].(map[string]any)["type"]) - require.Equal(t, "INTEGER", properties["count"].(map[string]any)["type"]) - require.NotContains(t, properties["empty"].(map[string]any), "type") + + pathSchema, ok := properties["path"].(map[string]any) + require.True(t, ok) + require.Equal(t, "STRING", pathSchema["type"]) + + countSchema, ok := properties["count"].(map[string]any) + require.True(t, ok) + require.Equal(t, "INTEGER", countSchema["type"]) + + emptySchema, ok := properties["empty"].(map[string]any) + require.True(t, ok) + require.NotContains(t, emptySchema, "type") } func TestConvertClaudeToolsToGeminiTools_PreservesWebSearchAlongsideFunctions(t *testing.T) {