[PR #1232] [CLOSED] fix: Add Gemini tool schema sanitization to MCP tools as well #9854

Closed
opened 2026-02-16 18:14:17 -05:00 by yindo · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/anomalyco/opencode/pull/1232
Author: @necaris
Created: 7/22/2025
Status: Closed

Base: devHead: test/gemini-sanitize


📝 Commits (5)

  • e8034b8 Add Gemini tool schema sanitization to provider middleware
  • 89a521a tests: fix snapshots
  • afe2707 fix: missing closing brace in session title generation
  • 7e472f3 feat: add missing transformToolSchema method to Provider namespace
  • 83faac6 refactor: replace sanitizeGeminiParameters with sanitizeGeminiJsonSchema in ProviderTransform

📊 Changes

9 files changed (+406 additions, -23 deletions)

View changed files

📝 packages/opencode/src/provider/provider.ts (+40 -3)
📝 packages/opencode/src/provider/transform.ts (+18 -0)
packages/opencode/src/provider/utils.ts (+82 -0)
📝 packages/opencode/src/session/index.ts (+34 -13)
📝 packages/opencode/src/tool/registry.ts (+1 -1)
📝 packages/opencode/test/bun.test.ts (+1 -1)
packages/opencode/test/provider.test.ts (+220 -0)
📝 packages/opencode/test/tool/__snapshots__/tool.test.ts.snap (+5 -0)
📝 packages/opencode/test/tool/tool.test.ts (+5 -5)

📄 Description

In addition to built-in tools in TOOL_MAPPING, add Gemini tool sanitization to MCP.tools() as well. This should have broader effects -- like fixing #1052 .


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/anomalyco/opencode/pull/1232 **Author:** [@necaris](https://github.com/necaris) **Created:** 7/22/2025 **Status:** ❌ Closed **Base:** `dev` ← **Head:** `test/gemini-sanitize` --- ### 📝 Commits (5) - [`e8034b8`](https://github.com/anomalyco/opencode/commit/e8034b87de9c4a69dc7ef1352fbd96388ad06efe) Add Gemini tool schema sanitization to provider middleware - [`89a521a`](https://github.com/anomalyco/opencode/commit/89a521ae166437c82c29bdf80316ca4a70304b48) tests: fix snapshots - [`afe2707`](https://github.com/anomalyco/opencode/commit/afe2707307a2438cce673b3c85d9fec4809950ee) fix: missing closing brace in session title generation - [`7e472f3`](https://github.com/anomalyco/opencode/commit/7e472f344432c794908ca9907534cd1d0d6c9541) feat: add missing transformToolSchema method to Provider namespace - [`83faac6`](https://github.com/anomalyco/opencode/commit/83faac672aee3801369e98cd9be9caf192467ed4) refactor: replace sanitizeGeminiParameters with sanitizeGeminiJsonSchema in ProviderTransform ### 📊 Changes **9 files changed** (+406 additions, -23 deletions) <details> <summary>View changed files</summary> 📝 `packages/opencode/src/provider/provider.ts` (+40 -3) 📝 `packages/opencode/src/provider/transform.ts` (+18 -0) ➕ `packages/opencode/src/provider/utils.ts` (+82 -0) 📝 `packages/opencode/src/session/index.ts` (+34 -13) 📝 `packages/opencode/src/tool/registry.ts` (+1 -1) 📝 `packages/opencode/test/bun.test.ts` (+1 -1) ➕ `packages/opencode/test/provider.test.ts` (+220 -0) 📝 `packages/opencode/test/tool/__snapshots__/tool.test.ts.snap` (+5 -0) 📝 `packages/opencode/test/tool/tool.test.ts` (+5 -5) </details> ### 📄 Description In addition to built-in tools in `TOOL_MAPPING`, add Gemini tool sanitization to `MCP.tools()` as well. This should have broader effects -- like fixing #1052 . --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
yindo added the pull-request label 2026-02-16 18:14:17 -05:00
yindo closed this issue 2026-02-16 18:14:17 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#9854