-
Notifications
You must be signed in to change notification settings - Fork 11.6k
Open
Labels
coreAnything pertaining to core functionality of the application (opencode server stuff)Anything pertaining to core functionality of the application (opencode server stuff)
Description
Bug Description
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
contentEncodingin tool schemas (e.g.chrome-devtools-mcp— tools liketake_screenshot,take_snapshot,upload_fileusecontentEncoding: "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:
contentEncodingcontentMediaType
Environment
- opencode v1.2.15
- MCP server: chrome-devtools-mcp (mcpm)
- Gemini model via oh-my-opencode Junior Sisyphus agent
Related
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
coreAnything pertaining to core functionality of the application (opencode server stuff)Anything pertaining to core functionality of the application (opencode server stuff)