Skip to content

Commit c474053

Browse files
authored
Merge pull request #37 from Tarquinen/fix/gemini-response-struct-format
fix: use Struct format for Gemini functionResponse
2 parents edc6932 + 8fdd9c4 commit c474053

File tree

4 files changed

+9
-6
lines changed

4 files changed

+9
-6
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ Add to your OpenCode config:
1313
```jsonc
1414
// opencode.jsonc
1515
{
16-
"plugin": ["@tarquinen/[email protected].21"]
16+
"plugin": ["@tarquinen/[email protected].22"]
1717
}
1818
```
1919

lib/fetch-wrapper/gemini.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,12 +78,15 @@ export async function handleGemini(
7878
contentModified = true
7979
replacedCount++
8080
// Preserve thoughtSignature if present (required for Gemini 3 Pro)
81-
// Only replace the response content, not the structure
81+
// response must be a Struct (object), not a plain string
8282
return {
8383
...part,
8484
functionResponse: {
8585
...part.functionResponse,
86-
response: PRUNED_CONTENT_MESSAGE
86+
response: {
87+
name: part.functionResponse.name,
88+
content: PRUNED_CONTENT_MESSAGE
89+
}
8790
}
8891
}
8992
}

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"$schema": "https://json.schemastore.org/package.json",
33
"name": "@tarquinen/opencode-dcp",
4-
"version": "0.3.21",
4+
"version": "0.3.22",
55
"type": "module",
66
"description": "OpenCode plugin that optimizes token usage by pruning obsolete tool outputs from conversation context",
77
"main": "./dist/index.js",

0 commit comments

Comments
 (0)