You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using Gemini-based agents (e.g. oh-my-opencode Junior Sisyphus) with MCP servers that define contentEncoding in their tool schemas, the Gemini API rejects the request with a 400 error.
The existing schema sanitizer (introduced in v1.0.137 via #3140) strips properties/required from non-object types, but does not strip contentEncoding or contentMediaType — both valid JSON Schema keywords that Gemini's function calling API doesn't support.
Error
Bad Request: {
"error": {
"code": 400,
"message": "Invalid JSON payload received. Unknown name \"contentEncoding\" at 'request.tools[0].function_declarations[87].parameters.properties[4].value.items.properties[2].value': Cannot find field.\nInvalid JSON payload received. Unknown name \"contentEncoding\" at 'request.tools[0].function_declarations[88].parameters.properties[4].value.items.properties[2].value': Cannot find field.\nInvalid JSON payload received. Unknown name \"contentEncoding\" at 'request.tools[0].function_declarations[89].parameters.properties[4].value.items.properties[2].value': Cannot find field.",
"status": "INVALID_ARGUMENT"
}
}
Reproduction
Configure an MCP server that uses contentEncoding in tool schemas (e.g. chrome-devtools-mcp — tools like take_screenshot, take_snapshot, upload_file use contentEncoding: "base64")
Start a session with a Gemini model
The API call fails with the above error
Expected Behavior
The Gemini schema sanitizer should strip unsupported JSON Schema keywords before sending function declarations. At minimum:
contentEncoding
contentMediaType
Environment
opencode v1.2.15
MCP server: chrome-devtools-mcp (mcpm)
Gemini model via oh-my-opencode Junior Sisyphus agent
Activity
Br1an67 commentedon Mar 1, 2026
I'd like to work on this. The fix adds
contentEncodingandcontentMediaTypestripping to the existingsanitizeGeminifunction intransform.ts.PR: #15593
github-actions commentedon Jul 3, 2026
To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.