Skip to content

Commit 8083b33

Browse files
committed
fix: simplify Gemini response structure for API compatibility
- Use string instead of nested object for functionResponse.response - Preserves thoughtSignature via spread operator (required for Gemini 3 Pro) - Aligns with Google's flexible response format
1 parent 56c5ff3 commit 8083b33

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

index.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -254,14 +254,13 @@ const plugin: Plugin = (async (ctx) => {
254254
if (toolCallId && allPrunedIds.has(toolCallId)) {
255255
contentModified = true
256256
replacedCount++
257+
// Preserve thoughtSignature if present (required for Gemini 3 Pro)
258+
// Only replace the response content, not the structure
257259
return {
258260
...part,
259261
functionResponse: {
260262
...part.functionResponse,
261-
response: {
262-
name: part.functionResponse.name,
263-
content: '[Output removed to save context - information superseded or no longer needed]'
264-
}
263+
response: '[Output removed to save context - information superseded or no longer needed]'
265264
}
266265
}
267266
}

0 commit comments

Comments
 (0)